Merge pull request #21219 from asenyaev:asen/remove_distutils

* Replaced distutils module to sysconfig

* Fixed getting a path to python lib
This commit is contained in:
Andrey Senyaev
2021-12-08 21:51:34 +03:00
committed by GitHub
parent 16b674b984
commit d6891c705e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ if(NOT ${found})
if(NOT ANDROID AND NOT IOS)
if(CMAKE_HOST_UNIX)
execute_process(COMMAND ${_executable} -c "from distutils.sysconfig import *; print(get_python_lib())"
execute_process(COMMAND ${_executable} -c "from sysconfig import *; print(get_path('purelib'))"
RESULT_VARIABLE _cvpy_process
OUTPUT_VARIABLE _std_packages_path
OUTPUT_STRIP_TRAILING_WHITESPACE)
+1 -1
View File
@@ -63,7 +63,7 @@ else()
if("${${PYTHON}_VERSION_MAJOR}" STREQUAL "2")
set(__python_ext_suffix_var "SO")
endif()
execute_process(COMMAND ${${PYTHON}_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('${__python_ext_suffix_var}'))"
execute_process(COMMAND ${${PYTHON}_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('${__python_ext_suffix_var}'))"
RESULT_VARIABLE PYTHON_CVPY_PROCESS
OUTPUT_VARIABLE CVPY_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)