gnucash stable: Replace deprecated distutils.sysconfig with sysconfig.

John Ralls jralls at code.gnucash.org
Thu Feb 22 19:33:00 EST 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/b217553c (commit)
	from  https://github.com/Gnucash/gnucash/commit/b9eb550b (commit)



commit b217553cf50b2a86f1069736a200dd1d4f5c6551
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Feb 22 10:47:59 2024 -0800

    Replace deprecated distutils.sysconfig with sysconfig.
    
    distutils is not present in Python 3.12.2.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbb910e3e1..341166576c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -510,7 +510,7 @@ if (WITH_PYTHON)
 
   # Determine where to install the python libraries.
   execute_process(
-    COMMAND ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}', plat_specific=True))"
+    COMMAND ${Python3_EXECUTABLE} -c "from sysconfig import get_path; print(get_path('platlib', 'posix_user', {'userbase': '${CMAKE_INSTALL_PREFIX}'}))"
     RESULT_VARIABLE PYTHON_SYSCONFIG_RESULT
     OUTPUT_VARIABLE PYTHON_SYSCONFIG_OUTPUT
     ERROR_VARIABLE PYTHON_SYSCONFIG_ERROR



Summary of changes:
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list