summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2010-03-17 19:34:48 +0000
committerGreg Hudson <ghudson@mit.edu>2010-03-17 19:34:48 +0000
commitefe92b4d5aeffd34d88edcf489d4df2a115a54d9 (patch)
tree24a3d533c5697c408392b006b7842dae6bd854c8 /src
parentd8bdfda988a1b76a30ecd0639cef24849eac4de3 (diff)
downloadkrb5-efe92b4d5aeffd34d88edcf489d4df2a115a54d9.tar.gz
krb5-efe92b4d5aeffd34d88edcf489d4df2a115a54d9.tar.xz
krb5-efe92b4d5aeffd34d88edcf489d4df2a115a54d9.zip
Fix the Python version check to use constructs available in older
versions of Python. (python --version was added in 2.5.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23813 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/configure.in14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/configure.in b/src/configure.in
index 46f2a25c8a..8e2afb2d41 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -930,19 +930,13 @@ AC_SUBST(HAVE_RUNTEST)
# For Python tests.
AC_CHECK_PROG(PYTHON,python,python)
+HAVE_PYTHON=no
if test x"$PYTHON" != x; then
# k5test.py requires python 2.4 (for the subprocess module).
- pyversion=$(python --version 2>&1 | awk '{print $2}')
- case $pyversion in
- 1.*|2.0.*|2.1.*|2.2.*|2.3.*)
- HAVE_PYTHON=no
- ;;
- *)
+ vercheck="import sys;sys.exit((sys.hexversion < 0x2040000) and 1 or 0)"
+ if python -c "$vercheck"; then
HAVE_PYTHON=yes
- ;;
- esac
-else
- HAVE_PYTHON=no
+ fi
fi
AC_SUBST(HAVE_PYTHON)