diff --git a/CHANGES b/CHANGES index 6fe2486a1f..1bde903a64 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4513. [cleanup] Minimum Python versions are now 2.7 and 3.2. + [RT #43566] + 4512. [bug] win32: @GEOIP_INC@ missing from delv.vcxproj.in. [RT #43556] diff --git a/configure b/configure index 87f16d07aa..8f5a08231a 100755 --- a/configure +++ b/configure @@ -11824,7 +11824,7 @@ else fi -python="python python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4" +python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7" testargparse='try: import argparse except: exit(1)' @@ -11832,6 +11832,10 @@ except: exit(1)' testply='try: from ply import * except: exit(1)' +testminvers='import sys +if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)): + exit(1)' + case "$use_python" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python support" >&5 @@ -11892,6 +11896,18 @@ done if test "X$PYTHON" = "X"; then continue; fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python2 version >= 2.7 or python3 version >= 3.2" >&5 +$as_echo_n "checking python2 version >= 2.7 or python3 version >= 3.2... " >&6; } + if ${PYTHON:-false} -c "$testminvers"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + unset ac_cv_path_PYTHON + unset PYTHON + continue + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking python module 'argparse'" >&5 $as_echo_n "checking python module 'argparse'... " >&6; } if ${PYTHON:-false} -c "$testargparse"; then @@ -11986,6 +12002,14 @@ done ;; esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python2 version >= 2.7 or python3 version >= 3.2" >&5 +$as_echo_n "checking python2 version >= 2.7 or python3 version >= 3.2... " >&6; } + if ${PYTHON:-false} -c "$testminvers"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + else + as_fn_error $? "not found" "$LINENO" 5 + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking python module 'argparse'" >&5 $as_echo_n "checking python module 'argparse'... " >&6; } if ${PYTHON:-false} -c "$testargparse"; then diff --git a/configure.in b/configure.in index 9f6e2775a7..20751d0e2b 100644 --- a/configure.in +++ b/configure.in @@ -208,7 +208,7 @@ AC_ARG_WITH(python, [ --with-python=PATH specify path to python interpreter], use_python="$withval", use_python="unspec") -python="python python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4" +python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7" testargparse='try: import argparse except: exit(1)' @@ -216,6 +216,10 @@ except: exit(1)' testply='try: from ply import * except: exit(1)' +testminvers='import sys +if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)): + exit(1)' + case "$use_python" in no) AC_MSG_CHECKING([for python support]) @@ -230,6 +234,15 @@ case "$use_python" in if test "X$PYTHON" = "X"; then continue; fi + AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2]) + if ${PYTHON:-false} -c "$testminvers"; then + AC_MSG_RESULT([found]) + else + AC_MSG_RESULT([not found]) + unset ac_cv_path_PYTHON + unset PYTHON + continue + fi AC_MSG_CHECKING([python module 'argparse']) if ${PYTHON:-false} -c "$testargparse"; then AC_MSG_RESULT([found]) @@ -272,6 +285,12 @@ case "$use_python" in AC_PATH_PROGS(PYTHON, $use_python) ;; esac + AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2]) + if ${PYTHON:-false} -c "$testminvers"; then + AC_MSG_RESULT([found]) + else + AC_MSG_ERROR([not found]) + fi AC_MSG_CHECKING([python module 'argparse']) if ${PYTHON:-false} -c "$testargparse"; then AC_MSG_RESULT([found, using $PYTHON])