mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-133951: Fix purelib packages not found in test_peg_generator TestCParser (GH-139607)
also includes purelib in TestCParser import context
This commit is contained in:
parent
36a6c2cdfa
commit
b73aaffb3d
1 changed files with 6 additions and 2 deletions
|
|
@ -100,11 +100,15 @@ def setUpClass(cls):
|
||||||
|
|
||||||
with contextlib.ExitStack() as stack:
|
with contextlib.ExitStack() as stack:
|
||||||
python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv"))
|
python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv"))
|
||||||
sitepackages = subprocess.check_output(
|
platlib_path = subprocess.check_output(
|
||||||
[python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"],
|
[python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"],
|
||||||
text=True,
|
text=True,
|
||||||
).strip()
|
).strip()
|
||||||
stack.enter_context(import_helper.DirsOnSysPath(sitepackages))
|
purelib_path = subprocess.check_output(
|
||||||
|
[python_exe, "-c", "import sysconfig; print(sysconfig.get_path('purelib'))"],
|
||||||
|
text=True,
|
||||||
|
).strip()
|
||||||
|
stack.enter_context(import_helper.DirsOnSysPath(platlib_path, purelib_path))
|
||||||
cls.addClassCleanup(stack.pop_all().close)
|
cls.addClassCleanup(stack.pop_all().close)
|
||||||
|
|
||||||
@support.requires_venv_with_pip()
|
@support.requires_venv_with_pip()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue