From 69f6e620c5add143bae95949cce0e3d65fe380a2 Mon Sep 17 00:00:00 2001 From: Sandro Date: Sat, 2 Mar 2024 19:02:12 +0100 Subject: [PATCH] Fix Python 3.12 support sysconfig is available since Python 3.2 Tested on nixpkgs and works as expected --- cpp/cmake_modules/FindPython3Alt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/FindPython3Alt.cmake b/cpp/cmake_modules/FindPython3Alt.cmake index cd74bea356625..a057be8da6311 100644 --- a/cpp/cmake_modules/FindPython3Alt.cmake +++ b/cpp/cmake_modules/FindPython3Alt.cmake @@ -67,7 +67,7 @@ get_target_property(NUMPY_INCLUDE_DIRS Python3::NumPy INTERFACE_INCLUDE_DIRECTOR # detect it ourselves. # (https://gitlab.kitware.com/cmake/cmake/issues/20408) execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" - "from distutils import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" + "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" RESULT_VARIABLE _PYTHON_RESULT OUTPUT_VARIABLE _PYTHON_STDOUT ERROR_VARIABLE _PYTHON_STDERR)