Skip to content

Commit

Permalink
Fix compatibility with Python 3.12+.
Browse files Browse the repository at this point in the history
The `distutils` module will be tossed in Python 3.12, so compensate for
that.
  • Loading branch information
Hoikas committed Sep 16, 2023
1 parent 3ec47d8 commit 9d48bc0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,10 @@ target_link_libraries(PyHSPlasma PUBLIC HSPlasma)
set_target_properties(PyHSPlasma PROPERTIES PREFIX "")

if(NOT WIN32)
execute_process(COMMAND Python3::Interpreter -c "import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'))"
OUTPUT_VARIABLE _PYTHON_LIB_DIR
execute_process(
COMMAND Python3::Interpreter -c
"import sys, sysconfig; sys.stdout.write(sysconfig.get_path('purelib', vars={'base': '${CMAKE_INSTALL_PREFIX}'}))"
OUTPUT_VARIABLE _PYTHON_LIB_DIR
)
install(TARGETS PyHSPlasma
DESTINATION ${_PYTHON_LIB_DIR}
Expand Down

0 comments on commit 9d48bc0

Please sign in to comment.