]>
Commit | Line | Data |
---|---|---|
df528f1e JR |
1 | diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 |
2 | --- a/m4/ax_python_devel.m4 | |
3 | +++ b/m4/ax_python_devel.m4 | |
4 | @@ -116,9 +116,11 @@ | |
5 | # | |
6 | if test -n "$1"; then | |
7 | AC_MSG_CHECKING([for a version of Python $1]) | |
8 | - ac_supports_python_ver=`$PYTHON -c "import sys; \ | |
9 | - ver = sys.version.split ()[[0]]; \ | |
10 | - print (ver $1)"` | |
11 | + read -r op ver <<< "$1" | |
12 | + script="m4_join([;], [import sys], [ver = sys.version_info[:3]], | |
13 | + [minver = tuple(map(int, ${ver}.split('.')))], | |
14 | + [print (ver ${op} minver)])" | |
15 | + ac_supports_python_ver=`$PYTHON -c "$script"` | |
16 | if test "$ac_supports_python_ver" = "True"; then | |
17 | AC_MSG_RESULT([yes]) | |
18 | else | |
19 | @@ -208,7 +208,7 @@ | |
20 | ac_python_version=$PYTHON_VERSION | |
21 | else | |
22 | ac_python_version=`$PYTHON -c "import sys; \ | |
23 | - print (sys.version[[:3]])"` | |
24 | + print ("%d.%d" % sys.version_info[[:2]])"` | |
25 | fi | |
26 | fi | |
27 | ||
28 | diff --git a/m4/ax_python.m4 b/m4/ax_python.m4 | |
29 | --- a/m4/ax_python.m4 | |
30 | +++ b/m4/ax_python.m4 | |
31 | @@ -55,7 +55,7 @@ | |
32 | AC_DEFUN([AX_PYTHON], | |
33 | [AC_MSG_CHECKING(for python build information) | |
34 | AC_MSG_RESULT([]) | |
35 | -for python in python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do | |
36 | +for python in python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do | |
37 | AC_CHECK_PROGS(PYTHON_BIN, [$python]) | |
38 | ax_python_bin=$PYTHON_BIN | |
39 | if test x$ax_python_bin != x; then |