From dbe31c72c8c52afa9f9805fd8e1bb87bccc5f328 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 2 May 2024 21:35:21 +0200 Subject: [PATCH] Upgrade detection of Python include path for Python 3.12 Fixes #577. * m4/pypath.m4: Python 3.12 removed distutils, so use sysconfig instead. * NEWS: Mention the bug. --- NEWS | 3 +++ m4/pypath.m4 | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 347f44488..59ccf6606 100644 --- a/NEWS +++ b/NEWS @@ -317,6 +317,9 @@ New in spot 2.11.6.dev (not yet released) by "a[->]". The latter should only replace "(!a)[*];a". (Issue #559.) + - The configure script failed to detect the include path for Python 3.12. + (Issue #577.) + New in spot 2.11.6 (2023-08-01) Bug fixes: diff --git a/m4/pypath.m4 b/m4/pypath.m4 index efdf57355..f750e172c 100644 --- a/m4/pypath.m4 +++ b/m4/pypath.m4 @@ -6,8 +6,8 @@ AC_DEFUN([adl_CHECK_PYTHON], esac AC_CACHE_CHECK([for $am_display_PYTHON includes directory], [adl_cv_python_inc], - [adl_cv_python_inc=`$PYTHON -c "import sys; from distutils import sysconfig;] -[sys.stdout.write(sysconfig.get_python_inc())" 2>/dev/null`]) + [adl_cv_python_inc=`$PYTHON -c "import sys, sysconfig;] +[sys.stdout.write(sysconfig.get_path('include'))" 2>/dev/null`]) AC_CACHE_CHECK([for $am_display_PYTHON extension suffix], [adl_cv_python_ext], [adl_cv_python_ext=`$PYTHON -c "import importlib.machinery as i; print(i.EXTENSION_SUFFIXES[[0]])"`])