Skip to content

Commit e539163

Browse files
authored
Merge pull request #2075 from evgenyz/fix-distutils
Replace `distutils.sysconfig` with `sysconfig`
2 parents 400ab5b + 9a8e01f commit e539163

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/developer/developer.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ On Ubuntu 18.04 and potentially other distro, the python3 dist-packages path is
113113
If the following command:
114114

115115
----
116-
$ python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
116+
$ python3 -c "import sysconfig; print(sysconfig.get_path('platlib'))"
117117
----
118118

119119
returns "/usr/local/lib/python3/dist-packages" instead of a path like

swig/python3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ add_custom_target(python3_compile ALL DEPENDS ${PYTHON_COMPILED_FILES})
2626

2727
if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR)
2828
execute_process(COMMAND
29-
${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))"
29+
${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib'))"
3030
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR
3131
OUTPUT_STRIP_TRAILING_WHITESPACE
3232
)

utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ if(ENABLE_OSCAP_UTIL_DOCKER)
9191

9292
if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR)
9393
execute_process(COMMAND
94-
${OSCAP_DOCKER_PYTHON} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False, False, prefix='${CMAKE_INSTALL_PREFIX}'))"
94+
${OSCAP_DOCKER_PYTHON} -c "import sysconfig; print(sysconfig.get_path('purelib'))"
9595
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR
9696
OUTPUT_STRIP_TRAILING_WHITESPACE
9797
)

0 commit comments

Comments
 (0)