diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -425,11 +425,12 @@ if test "$found_py" = "1" -o "$found_py3" = "1"; then # Reset everything, so that we can look for another Python. m4_foreach([mym4pythonver], - [[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[all]], + [[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[3.10],[all]], [unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS diff --git a/m4/python.m4 b/m4/python.m4 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -36,13 +36,12 @@ # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ - dnl Find a Python interpreter. Python versions prior to 2.0 are not - dnl supported. (2.0 was released on October 16, 2000). Python 3.0 - dnl through to Python 3.9 are also not supported. + dnl Find a Python interpreter. Python versions prior to 2.1 are not + dnl supported. Python 3.0 through to Python 3.3 are also not supported. m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python2 python2.7 dnl python dnl - python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 + python3 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 ]) AC_ARG_VAR([PYTHON], [the Python interpreter]) @@ -89,12 +88,12 @@ m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else - dnl Query Python for its version number. Getting [:3] seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. + dnl Query Python for its version number. Formatting sys.version_info[:2] + dnl seems to be the most reliable way to do this across versions 2.1 + dnl through 3.10; it's what "site.py" does in the standard 3.10 library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) + [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write('%d.%d' % sys.version_info[[:2]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding