From 9e5d945a7db06497fef2df7f89aef8b6db07311a Mon Sep 17 00:00:00 2001 From: William Dawson Date: Wed, 15 Nov 2023 13:19:02 +0900 Subject: [PATCH] try not using sysutils to get the python path credit ChatGPT --- Source/Swig/ConfigPython.cmake | 2 +- UnitTests/before_install.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Swig/ConfigPython.cmake b/Source/Swig/ConfigPython.cmake index d41ae4ca..f243c8d5 100644 --- a/Source/Swig/ConfigPython.cmake +++ b/Source/Swig/ConfigPython.cmake @@ -3,6 +3,6 @@ macro(get_py_include) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c - "from distutils.sysconfig import get_python_inc; print(get_python_inc())" + "import sysconfig; print(sysconfig.get_path('include'))" OUTPUT_VARIABLE PYTHON_INCLUDE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) endmacro() diff --git a/UnitTests/before_install.sh b/UnitTests/before_install.sh index e2626bd8..28c5e23e 100644 --- a/UnitTests/before_install.sh +++ b/UnitTests/before_install.sh @@ -32,5 +32,4 @@ elif [[ "$TESTOS" == "OSX" ]]; then sudo pip3 install flake8 --upgrade --no-cache-dir sudo pip3 install pyyaml --upgrade --no-cache-dir sudo pip3 install ford --upgrade --no-cache-dir - sudo pip3 install distutils --upgrade --no-cache-dir fi