summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-11-23 01:37:28 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-11-23 01:37:28 (GMT)
commitd76cdc161e2e9523c51af63e8f7cfd310ef1a74b (patch)
tree2e4e02d993a2fe27ce44e26b0869d6bb782262db /Lib/venv
parentfd66cc5534ffb8fbdd071b2c453744562a16e818 (diff)
downloadcpython-d76cdc161e2e9523c51af63e8f7cfd310ef1a74b.zip
cpython-d76cdc161e2e9523c51af63e8f7cfd310ef1a74b.tar.gz
cpython-d76cdc161e2e9523c51af63e8f7cfd310ef1a74b.tar.bz2
Close #19694: venv now runs ensurepip in isolated mode
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 2991c66..14158e9 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -234,8 +234,11 @@ class EnvBuilder:
def _setup_pip(self, context):
"""Installs or upgrades pip in a virtual environment"""
- cmd = [context.env_exe, '-m', 'ensurepip', '--upgrade',
- '--default-pip']
+ # We run ensurepip in isolated mode to avoid side effects from
+ # environment vars, the current directory and anything else
+ # intended for the global Python environment
+ cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade',
+ '--default-pip']
subprocess.check_output(cmd)
def setup_scripts(self, context):