Description: Adapt python.m4 to detect new Python3.10 and 3.11
Author: Gianfranco Costamagna <locutusofborg@debian.org>
Last-Update: 2022-01-17

--- esys-particle-2.3.5+dfsg2.orig/Config/python.m4
+++ esys-particle-2.3.5+dfsg2/Config/python.m4
@@ -49,7 +49,7 @@ AC_DEFUN([AM_PATH_PYTHON],
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
                     [python python2 python3 python2.0 python2.1 python2.2 dnl
 python2.3 python2.4 python2.5 python2.6 python2.7 python3.0 python3.1 python3.2 dnl
-python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9])
+python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.10 python3.11])
 
   m4_if([$1],[],[
     dnl No version check is needed.
@@ -95,7 +95,7 @@ python3.3 python3.4 python3.5 python3.6
   dnl the best way to do this; it's what "site.py" does in the standard
   dnl 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; print(str(sys.version_info.major) + '.' + str(sys.version_info.minor))"`])
   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
  
   dnl CHANGED FOR ESYS-PARTICLE:
