summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2017-02-02 19:17:02 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2017-02-02 19:17:02 (GMT)
commit993f535ae9276efc7be61fb06a67b629ff92e25d (patch)
tree787e7f5633247db55c66c6f8ddc67efb039101e8 /Lib/venv
parent64e91275e37d881832b7c0cacd1b45c4c4ef4ba4 (diff)
parentdb6322cb8ac1a8edede92e1aa1e3c688742a7923 (diff)
downloadcpython-993f535ae9276efc7be61fb06a67b629ff92e25d.zip
cpython-993f535ae9276efc7be61fb06a67b629ff92e25d.tar.gz
cpython-993f535ae9276efc7be61fb06a67b629ff92e25d.tar.bz2
Fixes #24875: Merged fix from 3.5.
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 0a094e3..308e046 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -57,6 +57,10 @@ class EnvBuilder:
"""
env_dir = os.path.abspath(env_dir)
context = self.ensure_directories(env_dir)
+ # See issue 24875. We need system_site_packages to be False
+ # until after pip is installed.
+ true_system_site_packages = self.system_site_packages
+ self.system_site_packages = False
self.create_configuration(context)
self.setup_python(context)
if self.with_pip:
@@ -64,6 +68,11 @@ class EnvBuilder:
if not self.upgrade:
self.setup_scripts(context)
self.post_setup(context)
+ if true_system_site_packages:
+ # We had set it to False before, now
+ # restore it and rewrite the configuration
+ self.system_site_packages = True
+ self.create_configuration(context)
def clear_directory(self, path):
for fn in os.listdir(path):