gh-128779: Fix site venv() for system site-packages (#129184)

This commit is contained in:
Victor Stinner 2025-01-30 01:02:31 +01:00 committed by GitHub
parent 99849ee0d3
commit a549f43938
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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