File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 24
24
from mesonbuild .mesonlib import windows_proof_rmtree , python_command , is_windows
25
25
from mesonbuild .coredata import version as meson_version
26
26
27
+ # Handle the scheme that Debian patches in the as default
28
+ import sysconfig
29
+ # This function was renamed and made public in Python 3.10
30
+ if hasattr (sysconfig , 'get_default_scheme' ):
31
+ scheme = sysconfig .get_default_scheme ()
32
+ else :
33
+ scheme = sysconfig ._get_default_scheme ()
34
+ if scheme == 'posix_local' :
35
+ scheme = 'posix_prefix'
27
36
28
37
def get_pypath ():
29
- import sysconfig
30
- pypath = sysconfig .get_path ('purelib' , vars = {'base' : '' })
38
+ pypath = sysconfig .get_path ('purelib' , scheme = scheme , vars = {'base' : '' })
31
39
# Ensure that / is the path separator and not \, then strip /
32
40
return Path (pypath ).as_posix ().strip ('/' )
33
41
34
42
def get_pybindir ():
35
- import sysconfig
36
43
# 'Scripts' on Windows and 'bin' on other platforms including MSYS
37
- return sysconfig .get_path ('scripts' , vars = {'base' : '' }).strip ('\\ /' )
44
+ return sysconfig .get_path ('scripts' , scheme = scheme , vars = {'base' : '' }).strip ('\\ /' )
38
45
39
46
class CommandTests (unittest .TestCase ):
40
47
'''
You can’t perform that action at this time.
0 commit comments