aboutsummaryrefslogtreecommitdiff
path: root/run_meson_command_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2022-04-22 16:19:21 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2022-04-23 11:57:06 +0300
commita2079939de2d1d271e5ea7f23c3656a73e325728 (patch)
tree1098df1ec06045218d035bca1cfb52e96a8e4939 /run_meson_command_tests.py
parent3c8343b4837744ae7dc1ee21eeefb93cd044b611 (diff)
downloadmeson-a2079939de2d1d271e5ea7f23c3656a73e325728.zip
meson-a2079939de2d1d271e5ea7f23c3656a73e325728.tar.gz
meson-a2079939de2d1d271e5ea7f23c3656a73e325728.tar.bz2
Use system install scheme rather than the incorrect Debian one.
Diffstat (limited to 'run_meson_command_tests.py')
-rwxr-xr-xrun_meson_command_tests.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/run_meson_command_tests.py b/run_meson_command_tests.py
index 36cb02e..03083f0 100755
--- a/run_meson_command_tests.py
+++ b/run_meson_command_tests.py
@@ -24,17 +24,24 @@ from pathlib import Path
from mesonbuild.mesonlib import windows_proof_rmtree, python_command, is_windows
from mesonbuild.coredata import version as meson_version
+# Handle the scheme that Debian patches in the as default
+import sysconfig
+# This function was renamed and made public in Python 3.10
+if hasattr(sysconfig, 'get_default_scheme'):
+ scheme = sysconfig.get_default_scheme()
+else:
+ scheme = sysconfig._get_default_scheme()
+if scheme == 'posix_local':
+ scheme = 'posix_prefix'
def get_pypath():
- import sysconfig
- pypath = sysconfig.get_path('purelib', vars={'base': ''})
+ pypath = sysconfig.get_path('purelib', scheme=scheme, vars={'base': ''})
# Ensure that / is the path separator and not \, then strip /
return Path(pypath).as_posix().strip('/')
def get_pybindir():
- import sysconfig
# 'Scripts' on Windows and 'bin' on other platforms including MSYS
- return sysconfig.get_path('scripts', vars={'base': ''}).strip('\\/')
+ return sysconfig.get_path('scripts', scheme=scheme, vars={'base': ''}).strip('\\/')
class CommandTests(unittest.TestCase):
'''