]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128779: Fix site venv() for system site-packages (#129184)
authorVictor Stinner <vstinner@python.org>
Thu, 30 Jan 2025 00:02:31 +0000 (01:02 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2025 00:02:31 +0000 (00:02 +0000)
Lib/site.py

index 92bd1ccdadd924ace61240f24262d63e02ee1a32..9da8b6724e1cec5778bb9689487a367622debf99 100644 (file)
@@ -633,12 +633,9 @@ def venv(known_paths):
         # Doing this here ensures venv takes precedence over user-site
         addsitepackages(known_paths, [sys.prefix])
 
-        # addsitepackages will process site_prefix again if its in PREFIXES,
-        # but that's ok; known_paths will prevent anything being added twice
         if system_site == "true":
-            PREFIXES.insert(0, sys.prefix)
+            PREFIXES += [sys.base_prefix, sys.base_exec_prefix]
         else:
-            PREFIXES = [sys.prefix]
             ENABLE_USER_SITE = False
 
     return known_paths