[PATCH v2] python: prioritize python 3.x over 2.x

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <[email protected]>
Since Python 2.x went EOL years ago, stop searching for it before
any of the Python 3 versions.

* m4/python.m4: Move python2 after all python3 versions.
* NEWS: Mention update in version search.
---
 NEWS         | 6 ++++++
 m4/python.m4 | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 57fd4275b8a7..73c8a8e01407 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,12 @@ please see NEWS-2.0 and start following the advice there now.
 
 New in 1.17:
 
+* Miscellaneous changes
+
+  - AM_PATH_PYTHON will, after checking `python`, prefer any Python 3
+    version over any Python 2 version.  If a specific version of Python 2 is
+    still needed, the $PYTHON variable can be set beforehand.
+
 * New features added
 
   - RANLIB may be overridden on a per-target basis.
diff --git a/m4/python.m4 b/m4/python.m4
index 6653e4d89eb2..15f5484c6d5d 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -37,10 +37,11 @@ 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).
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-[python python2 python3 dnl
+[python python3 dnl
  python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 dnl
  python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl
  python3.2 python3.1 python3.0 dnl
+ python2 dnl
  python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl
  python2.0])
 
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.