Skip to content

Commit

Permalink
pythongh-128779: Fix site venv() for system site-packages
Browse files Browse the repository at this point in the history
Add sys.base_exec_prefix to prefixes if pyvenv.cfg enables system
site-packages.
  • Loading branch information
vstinner committed Jan 22, 2025
1 parent 2ed5ee9 commit 246967f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ def venv(known_paths):
# but that's ok; known_paths will prevent anything being added twice
if system_site == "true":
PREFIXES.insert(0, sys.prefix)
if sys.base_exec_prefix != sys.exec_prefix:
PREFIXES.append(sys.base_exec_prefix)
else:
PREFIXES = [sys.prefix]
ENABLE_USER_SITE = False
Expand Down

0 comments on commit 246967f

Please sign in to comment.