Skip to content

Commit 7ea49ee

Browse files
committed
cmake: modernize the query of PYTHON_SITEARCH
... to eliminate the following warnings with python3-3.10.0~b4-2.fc35: <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
1 parent 64e7d98 commit 7ea49ee

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ ${PYTHON_INCLUDE_DIR}/pyconfig.h does not exits")
115115

116116
# query PYTHON_SITEARCH
117117
execute_process(COMMAND ${PYTHON_EXECUTABLE}
118-
-c "from distutils.sysconfig import get_python_lib
119-
print(get_python_lib(1))"
118+
-c "import sysconfig; print(sysconfig.get_paths()['platlib'])"
120119
RESULT_VARIABLE PYTHON_SITEARCH_STATUS
121120
OUTPUT_VARIABLE PYTHON_SITEARCH
122121
OUTPUT_STRIP_TRAILING_WHITESPACE)

0 commit comments

Comments
 (0)