Skip to content

Commit 35a73a0

Browse files
committed
Fix compatibility with Python 3.12+.
The `distutils` module will be tossed in Python 3.12, so compensate for that.
1 parent 70c8439 commit 35a73a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,10 @@ target_link_libraries(PyHSPlasma PUBLIC HSPlasma)
762762
set_target_properties(PyHSPlasma PROPERTIES PREFIX "")
763763

764764
if(NOT WIN32)
765-
execute_process(COMMAND Python3::Interpreter -c "import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'))"
766-
OUTPUT_VARIABLE _PYTHON_LIB_DIR
765+
execute_process(
766+
COMMAND "${Python3_EXECUTABLE}" -c
767+
"import sys, sysconfig; sys.stdout.write(sysconfig.get_path('purelib', vars={'base': '${CMAKE_INSTALL_PREFIX}'}))"
768+
OUTPUT_VARIABLE _PYTHON_LIB_DIR
767769
)
768770
install(TARGETS PyHSPlasma
769771
DESTINATION ${_PYTHON_LIB_DIR}

0 commit comments

Comments
 (0)