https://github.com/python/cpython/commit/b73aaffb3da0174ee8ae62767b6c363996cfe90c
commit: b73aaffb3da0174ee8ae62767b6c363996cfe90c
branch: main
author: Cycloctane <[email protected]>
committer: encukou <[email protected]>
date: 2025-10-06T14:40:48+02:00
summary:

gh-133951: Fix purelib packages not found in test_peg_generator TestCParser 
(GH-139607)

also includes purelib in TestCParser import context

files:
M Lib/test/test_peg_generator/test_c_parser.py

diff --git a/Lib/test/test_peg_generator/test_c_parser.py 
b/Lib/test/test_peg_generator/test_c_parser.py
index aa01a9b8f7ed87..395f15b9a62cdf 100644
--- a/Lib/test/test_peg_generator/test_c_parser.py
+++ b/Lib/test/test_peg_generator/test_c_parser.py
@@ -100,11 +100,15 @@ def setUpClass(cls):
 
         with contextlib.ExitStack() as stack:
             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'))"],
                 text=True,
             ).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)
 
     @support.requires_venv_with_pip()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to