Skip to content

Commit b43a166

Browse files
jpakkanenirbheek
authored andcommitted
Use system install scheme rather than the incorrect Debian one.
1 parent 3a03457 commit b43a166

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

run_meson_command_tests.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@
2424
from mesonbuild.mesonlib import windows_proof_rmtree, python_command, is_windows
2525
from mesonbuild.coredata import version as meson_version
2626

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'
2736

2837
def get_pypath():
29-
import sysconfig
30-
pypath = sysconfig.get_path('purelib', vars={'base': ''})
38+
pypath = sysconfig.get_path('purelib', scheme=scheme, vars={'base': ''})
3139
# Ensure that / is the path separator and not \, then strip /
3240
return Path(pypath).as_posix().strip('/')
3341

3442
def get_pybindir():
35-
import sysconfig
3643
# '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('\\/')
3845

3946
class CommandTests(unittest.TestCase):
4047
'''

0 commit comments

Comments
 (0)