Browse Source

dist: Switch FreezeTool over to sysconfig

distutils is deprecated and will be removed as of Python 3.12

Its use should not be affected by #1230 since it only uses it to query the include directory, not any other paths

Addresses part of #1395
rdb 2 years ago
parent
commit
036e5dc2db
1 changed files with 3 additions and 3 deletions
  1. 3 3
      direct/src/dist/FreezeTool.py

+ 3 - 3
direct/src/dist/FreezeTool.py

@@ -9,7 +9,7 @@ import imp
 import platform
 import platform
 import struct
 import struct
 import io
 import io
-import distutils.sysconfig as sysconf
+import sysconfig
 import zipfile
 import zipfile
 import importlib
 import importlib
 import warnings
 import warnings
@@ -170,8 +170,8 @@ class CompilationEnvironment:
 
 
         # Paths to Python stuff.
         # Paths to Python stuff.
         self.Python = None
         self.Python = None
-        self.PythonIPath = sysconf.get_python_inc()
-        self.PythonVersion = sysconf.get_config_var("LDVERSION") or sysconf.get_python_version()
+        self.PythonIPath = sysconfig.get_path('include')
+        self.PythonVersion = sysconfig.get_config_var("LDVERSION") or sysconfig.get_python_version()
 
 
         # The VC directory of Microsoft Visual Studio (if relevant)
         # The VC directory of Microsoft Visual Studio (if relevant)
         self.MSVC = None
         self.MSVC = None