From: Greg Hudson Date: Thu, 1 Aug 2019 21:55:42 +0000 (-0400) Subject: Require Python 3.2.4 for test scripts X-Git-Tag: krb5-1.18-beta1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F961%2Fhead;p=thirdparty%2Fkrb5.git Require Python 3.2.4 for test scripts In Python 3 releases before 3.2.4, the subprocess.Popen.communicate method does not accept string inputs when universal_newlines=True is set (see https://bugs.python.org/issue16903). Also substitute the minimum Python version displayed by "make check-pytests-no" from configure.ac to help keep it in sync with the minimum version we check for. --- diff --git a/src/Makefile.in b/src/Makefile.in index 31135ffccd..691f86c1ee 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -494,8 +494,9 @@ check-prerecurse: runenv.py check-unix: check-lmdb-$(HAVE_LMDB) cat $(SKIPTESTS) +MINPYTHON = @PYTHON_MINVERSION@ check-pytests-no: check-postrecurse - @echo 'Skipped python test scripts: python 3 required' >> \ + @echo 'Skipped python test scripts: python $(MINPYTHON) required' >> \ $(SKIPTESTS) check-cmocka-no: check-postrecurse diff --git a/src/configure.ac b/src/configure.ac index b7198c2b2b..171bad4bf4 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1142,14 +1142,18 @@ else fi AC_SUBST(HAVE_RUNTEST) -# For Python tests. +# For Python tests. Python version 3.2.4 is required as prior +# versions do not accept string input to subprocess.Popen.communicate +# when universal_newlines is set. +PYTHON_MINVERSION=3.2.4 +AC_SUBST(PYTHON_MINVERSION) AC_CHECK_PROG(PYTHON,python3,python3) if test x"$PYTHON" = x; then AC_CHECK_PROG(PYTHON,python,python) fi HAVE_PYTHON=no if test x"$PYTHON" != x; then - wantver="(sys.hexversion >= 0x3000000)" + wantver="(sys.hexversion >= 0x30204F0)" if "$PYTHON" -c "import sys; sys.exit(not $wantver and 1 or 0)"; then HAVE_PYTHON=yes fi