summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMiro Hron\v{c}ok <miro@hroncok.cz>2020-10-27 14:33:46 -0700
committerKarl Berry <karl@freefriends.org>2020-10-27 14:33:46 -0700
commite21d46fddd0753e66a4acda88317670fee07f3e6 (patch)
treeb9182fc9804eac7a89708defed3a5190cacb9667 /t
parent310edf02fb3f6da76500c813900d4cea7d9f36d8 (diff)
downloadautomake-e21d46fddd0753e66a4acda88317670fee07f3e6.tar.gz
python: determine Python (3.10) version number correctly.
This change fixes https://bugs.gnu.org/44239 (and https://bugzilla.redhat.com/show_bug.cgi?id=1889732). * m4/python.m4: use print('%u.%u' % sys.version_info[:2]) for the version number instead of merely sys.version[:3], so the numbers are treated as numbers. * t/python-vars.sh (PYTHON_VERSION): Likewise. * doc/automake.texi: Document it. * NEWS: mention it. (Minor tweaks from Karl Berry.)
Diffstat (limited to 't')
-rw-r--r--t/python-vars.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/python-vars.sh b/t/python-vars.sh
index 5c748bcf1..b53018b37 100644
--- a/t/python-vars.sh
+++ b/t/python-vars.sh
@@ -28,7 +28,9 @@ CONFIG_SITE=/dev/null; export CONFIG_SITE
# vary among different python installations, so we need more relaxed
# and ad-hoc checks for them. Also, more proper "functional" checks
# on them should be done in the 'python-virtualenv.sh' test.
-PYTHON_VERSION=$($PYTHON -c 'import sys; print(sys.version[:3])') || exit 1
+#
+# This version identification is duplicated in python.m4 (and the manual).
+PYTHON_VERSION=$($PYTHON -c 'import sys; print("%u.%u" % sys.version_info[:2])') || exit 1
PYTHON_PLATFORM=$($PYTHON -c 'import sys; print(sys.platform)') || exit 1
PYTHON_EXEC_PREFIX='${exec_prefix}'
PYTHON_PREFIX='${prefix}'