Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading