]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133951: Fix purelib packages not found in test_peg_generator TestCParser (GH-139607)
authorCycloctane <Cycloctane@outlook.com>
Mon, 6 Oct 2025 12:40:48 +0000 (20:40 +0800)
committerGitHub <noreply@github.com>
Mon, 6 Oct 2025 12:40:48 +0000 (14:40 +0200)
also includes purelib in TestCParser import context

Lib/test/test_peg_generator/test_c_parser.py

index aa01a9b8f7ed87ffdb1f3a172222687c3ae1826d..395f15b9a62cdfc1eb19710652fd33a424b44b76 100644 (file)
@@ -100,11 +100,15 @@ class TestCParser(unittest.TestCase):
 
         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()