Skip to content

Commit 80c28d1

Browse files
authored
Merge pull request numpy#19884 from kmod/support_pyston
TST: Make this sysconfig handling a bit more portable
2 parents 5d75d48 + 0daa86b commit 80c28d1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

runtests.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -474,23 +474,18 @@ def build_project(args):
474474
'--single-version-externally-managed',
475475
'--record=' + dst_dir + 'tmp_install_log.txt']
476476

477-
py_v_s = sysconfig.get_config_var('py_version_short')
478-
platlibdir = getattr(sys, 'platlibdir', '') # Python3.9+
477+
config_vars = dict(sysconfig.get_config_vars())
478+
config_vars["platbase"] = dst_dir
479+
config_vars["base"] = dst_dir
480+
479481
site_dir_template = os.path.normpath(sysconfig.get_path(
480482
'platlib', expand=False
481483
))
482-
site_dir = site_dir_template.format(platbase=dst_dir,
483-
py_version_short=py_v_s,
484-
platlibdir=platlibdir,
485-
base=dst_dir,
486-
)
484+
site_dir = site_dir_template.format(**config_vars)
487485
noarch_template = os.path.normpath(sysconfig.get_path(
488486
'purelib', expand=False
489487
))
490-
site_dir_noarch = noarch_template.format(base=dst_dir,
491-
py_version_short=py_v_s,
492-
platlibdir=platlibdir,
493-
)
488+
site_dir_noarch = noarch_template.format(**config_vars)
494489

495490
# easy_install won't install to a path that Python by default cannot see
496491
# and isn't on the PYTHONPATH. Plus, it has to exist.

0 commit comments

Comments
 (0)