Replace use of distutils to get installation location for init_env.py

This commit is contained in:
Kovid Goyal 2021-12-13 20:29:35 +05:30
parent 821f71cc4c
commit 7632beb8e0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -155,8 +155,10 @@ class Develop(Command):
self.success() self.success()
def install_env_module(self): def install_env_module(self):
import distutils.sysconfig as s import sysconfig
libdir = s.get_python_lib(prefix=self.opts.staging_root) libdir = os.path.join(
self.opts.staging_root, sysconfig.get_config_var('PLATLIBDIR') or 'lib',
sysconfig.get_python_version(), 'site-packages')
try: try:
if not os.path.exists(libdir): if not os.path.exists(libdir):
os.makedirs(libdir) os.makedirs(libdir)