python-r1.eclass: python_setup, use _python_impl_matches()
authorMichał Górny <mgorny@gentoo.org>
Wed, 10 May 2017 15:24:37 +0000 (17:24 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 16 May 2017 17:11:34 +0000 (19:11 +0200)
eclass/python-r1.eclass

index 99dfc50281293e1796c4a9cb19d955173ccaf0af..f26233f7e8558509022dd93206f7332ebd0a7238 100644 (file)
@@ -601,12 +601,9 @@ python_setup() {
 
        local best_impl patterns=( "${@-*}" )
        _python_try_impl() {
-               local pattern
-               for pattern in "${patterns[@]}"; do
-                       if [[ ${EPYTHON} == ${pattern} ]]; then
-                               best_impl=${EPYTHON}
-                       fi
-               done
+               if _python_impl_matches "${impl}" "${patterns[@]}"; then
+                       best_impl=${EPYTHON}
+               fi
        }
        python_foreach_impl _python_try_impl
        unset -f _python_try_impl