Skip to content

Commit 4e5ce3c

Browse files
committed
Reject too-old Python versions a bit sooner.
Commit 04aad40 added this check after the search for a Python shared library, which seems to me to be a pretty unfriendly ordering. The search might fail for what are basically version-related reasons, and in such a case it'd be better to say "your Python is too old" than "could not find shared library for Python".
1 parent 04aad40 commit 4e5ce3c

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

config/python.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ fi
1818

1919
# _PGAC_CHECK_PYTHON_DIRS
2020
# -----------------------
21-
# Determine the name of various directories of a given Python installation.
21+
# Determine the name of various directories of a given Python installation,
22+
# as well as the Python version.
2223
AC_DEFUN([_PGAC_CHECK_PYTHON_DIRS],
2324
[AC_REQUIRE([PGAC_PATH_PYTHON])
2425
AC_MSG_CHECKING([for Python distutils module])
@@ -36,6 +37,11 @@ python_version=`${PYTHON} -c "import sys; print(sys.version[[:3]])"`
3637
python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
3738
AC_MSG_RESULT([$python_configdir])
3839
40+
# Reject unsupported Python versions as soon as practical.
41+
if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
42+
AC_MSG_ERROR([Python version $python_version is too old (version 2.4 or later is required)])
43+
fi
44+
3945
AC_MSG_CHECKING([Python include directories])
4046
python_includespec=`${PYTHON} -c "
4147
import distutils.sysconfig

configure

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7594,6 +7594,11 @@ python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filte
75947594
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
75957595
$as_echo "$python_configdir" >&6; }
75967596

7597+
# Reject unsupported Python versions as soon as practical.
7598+
if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
7599+
as_fn_error $? "Python version $python_version is too old (version 2.4 or later is required)" "$LINENO" 5
7600+
fi
7601+
75977602
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python include directories" >&5
75987603
$as_echo_n "checking Python include directories... " >&6; }
75997604
python_includespec=`${PYTHON} -c "
@@ -7699,9 +7704,6 @@ $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
76997704

77007705

77017706

7702-
if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
7703-
as_fn_error $? "Python version $python_version is too old (version 2.4 or later is required)" "$LINENO" 5
7704-
fi
77057707
fi
77067708

77077709
if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then

configure.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,6 @@ fi
927927
if test "$with_python" = yes; then
928928
PGAC_PATH_PYTHON
929929
PGAC_CHECK_PYTHON_EMBED_SETUP
930-
if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
931-
AC_MSG_ERROR([Python version $python_version is too old (version 2.4 or later is required)])
932-
fi
933930
fi
934931

935932
if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy