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
This commit is contained in:
rdb 2023-02-24 17:07:36 +01:00
parent eeba583176
commit 036e5dc2db

View File

@ -9,7 +9,7 @@ import imp
import platform
import struct
import io
import distutils.sysconfig as sysconf
import sysconfig
import zipfile
import importlib
import warnings
@ -170,8 +170,8 @@ class CompilationEnvironment:
# Paths to Python stuff.
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)
self.MSVC = None