Skip to content

Commit ae6cfe4

Browse files
Cycloctanedanigm
authored andcommitted
pythongh-133951: Fix purelib packages not found in test_peg_generator TestCParser (pythonGH-139607)
also includes purelib in TestCParser import context
1 parent 29ad5e9 commit ae6cfe4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_peg_generator/test_c_parser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,15 @@ def setUpClass(cls):
100100

101101
with contextlib.ExitStack() as stack:
102102
python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv"))
103-
sitepackages = subprocess.check_output(
103+
platlib_path = subprocess.check_output(
104104
[python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"],
105105
text=True,
106106
).strip()
107-
stack.enter_context(import_helper.DirsOnSysPath(sitepackages))
107+
purelib_path = subprocess.check_output(
108+
[python_exe, "-c", "import sysconfig; print(sysconfig.get_path('purelib'))"],
109+
text=True,
110+
).strip()
111+
stack.enter_context(import_helper.DirsOnSysPath(platlib_path, purelib_path))
108112
cls.addClassCleanup(stack.pop_all().close)
109113

110114
@support.requires_venv_with_pip()

0 commit comments

Comments
 (0)