This partially reverts commit 7777d53d2f4b84cc77868f2a55d66417fe6058d0.

Python2 check for "six.moves.range" is not reverted.

Signed-off-by: Timothy Redaelli <[email protected]>
---
 m4/openvswitch.m4 | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 3f301b23b..f05b65c58 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -371,26 +371,22 @@ else:
             fi
           done
         done
+        if test $ovs_cv_python != no && test -x "$ovs_cv_python"; then
+          if ! "$ovs_cv_python" -c 'import six ; six.moves.range' 
>&AS_MESSAGE_LOG_FD 2>&1; then
+            ovs_cv_python=no
+            AC_MSG_WARN([Missing Python six library or version too old.])
+          fi
+        fi
       fi])
-
-   # Set $PYTHON from cache variable.
-   if test $ovs_cv_python = no; then
-     AC_MSG_ERROR([cannot find python 2.7 or higher.])
-   fi
-   AM_MISSING_PROG([PYTHON], [python])
-   PYTHON=$ovs_cv_python
-
-   # HAVE_PYTHON is always true.  (Python has not always been a build
-   # requirement, so this variable is now obsolete.)
    AC_SUBST([HAVE_PYTHON])
-   HAVE_PYTHON=yes
-   AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])
-
-   AC_MSG_CHECKING([whether $PYTHON has six library])
-   if ! $PYTHON -c 'import six ; six.moves.range' >&AS_MESSAGE_LOG_FD 2>&1; 
then
-     AC_MSG_ERROR([Missing Python six library or version too old.])
+   AM_MISSING_PROG([PYTHON], [python])
+   if test $ovs_cv_python != no; then
+     PYTHON=$ovs_cv_python
+     HAVE_PYTHON=yes
+   else
+     HAVE_PYTHON=no
    fi
-   AC_MSG_RESULT([yes])])
+   AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])
 
 dnl Checks for Python 3.x, x >= 4.
 AC_DEFUN([OVS_CHECK_PYTHON3],
-- 
2.17.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to