mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #4284 from pypa/bugfix/4276
Fix incorrect environment when inside venv
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix a bug that system-wide packages will be considered when inside a venv.
|
||||
+2
-2
@@ -330,11 +330,11 @@ class Project(object):
|
||||
|
||||
def get_environment(self, allow_global=False):
|
||||
# type: (bool) -> Environment
|
||||
if allow_global:
|
||||
is_venv = is_in_virtualenv()
|
||||
if allow_global and not is_venv:
|
||||
prefix = sys.prefix
|
||||
else:
|
||||
prefix = self.virtualenv_location
|
||||
is_venv = is_in_virtualenv()
|
||||
sources = self.sources if self.sources else [DEFAULT_SOURCE]
|
||||
environment = Environment(
|
||||
prefix=prefix, is_venv=is_venv, sources=sources, pipfile=self.parsed_pipfile,
|
||||
|
||||
Reference in New Issue
Block a user