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

python: set also sys._base_executable as venv uses it #250935

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion pkgs/development/interpreters/python/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if paths:
functools.reduce(lambda k, p: site.addsitedir(p, k), paths.split(':'), site._init_pathinfo())

# Check whether we are in a venv or virtualenv.
# Check whether we are in a venv or virtualenv.
# For Python 3 we check whether our `base_prefix` is different from our current `prefix`.
# For Python 2 we check whether the non-standard `real_prefix` is set.
# https://stackoverflow.com/questions/1871549/determine-if-python-is-running-inside-virtualenv
Expand All @@ -33,6 +33,7 @@

if 'PYTHONEXECUTABLE' not in os.environ and executable is not None:
sys.executable = executable
sys._base_executable = executable
if prefix is not None:
# Sysconfig does not like it when sys.prefix is set to None
sys.prefix = sys.exec_prefix = prefix
Expand Down