From 5e77b2498a963a05663ed466e655dbd0dacafe63 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 25 Feb 2012 13:22:43 +0100 Subject: [PATCH] Fix computation of PYTHONINC for Python 3. * m4/pypath.m4: The print syntax changed in Python 3, so use sys.stdout.write for compatibility with all versions. --- ChangeLog | 7 +++++++ m4/pypath.m4 | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 365bdb7b5..4faf8b2d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-24 Alexandre Duret-Lutz + + Fix computation of PYTHONINC for Python 3. + + * m4/pypath.m4: The print syntax changed in Python 3, so use + sys.stdout.write for compatibility with all versions. + 2012-02-04 Alexandre Duret-Lutz * HACKING: Minor updates and corrections. diff --git a/m4/pypath.m4 b/m4/pypath.m4 index 5af6736d8..b029e01b9 100644 --- a/m4/pypath.m4 +++ b/m4/pypath.m4 @@ -1,6 +1,7 @@ -AC_DEFUN([adl_CHECK_PYTHON], +AC_DEFUN([adl_CHECK_PYTHON], [AM_PATH_PYTHON([2.0]) AC_CACHE_CHECK([for $am_display_PYTHON includes directory], [adl_cv_python_inc], - [adl_cv_python_inc=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null`]) + [adl_cv_python_inc=`$PYTHON -c "import sys; from distutils import sysconfig;] +[sys.stdout.write(sysconfig.get_python_inc())" 2>/dev/null`]) AC_SUBST([PYTHONINC], [$adl_cv_python_inc])]) -- GitLab