Merge pull request #4317 from nstapelbroek/remove-osx-pyenv-launcher-variable

Stop using PYVENV_LAUNCHER env variable when detecting venvs
This commit is contained in:
Frost Ming
2020-06-05 09:00:20 +08:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
Fix falsely flagging a Homebrew installed Python as a virtual environment
+3 -3
View File
@@ -81,7 +81,7 @@ PIPENV_IS_CI = bool("CI" in os.environ or "TF_BUILD" in os.environ)
# HACK: Prevent invalid shebangs with Homebrew-installed Python:
# https://bugs.python.org/issue22490
_OSX_VENV = os.environ.pop("__PYVENV_LAUNCHER__", None)
os.environ.pop("__PYVENV_LAUNCHER__", None)
# Load patched pip instead of system pip
os.environ["PIP_SHIMS_BASE_MODULE"] = fs_str("pipenv.patched.notpip")
@@ -326,7 +326,7 @@ PIPENV_TEST_INDEX = os.environ.get("PIPENV_TEST_INDEX")
PIPENV_USE_SYSTEM = False
PIPENV_VIRTUALENV = None
if "PIPENV_ACTIVE" not in os.environ and not PIPENV_IGNORE_VIRTUALENVS:
PIPENV_VIRTUALENV = os.environ.get("VIRTUAL_ENV") or _OSX_VENV
PIPENV_VIRTUALENV = os.environ.get("VIRTUAL_ENV")
PIPENV_USE_SYSTEM = bool(PIPENV_VIRTUALENV)
# Internal, tells Pipenv to skip case-checking (slow internet connections).
@@ -370,7 +370,7 @@ def is_quiet(threshold=-1):
def _is_using_venv():
# type: () -> bool
"""Check for venv-based virtual environment which sets sys.base_prefix"""
return _OSX_VENV is not None or sys.prefix != getattr(sys, "base_prefix", sys.prefix)
return sys.prefix != getattr(sys, "base_prefix", sys.prefix)
def _is_using_virtualenv():