◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
24 changes: 17 additions & 7 deletions Lib/venv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ def create_if_needed(d):
context.bin_name = binname
context.env_exe = os.path.join(binpath, exename)
create_if_needed(binpath)
return context

def create_configuration(self, context):
Expand Down Expand Up @@ -293,8 +307,8 @@ def _setup_pip(self, context):
# 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, stderr=subprocess.STDOUT)

def setup_scripts(self, context):
Expand Down Expand Up @@ -394,11 +408,7 @@ def upgrade_dependencies(self, context):
logger.debug(
f'Upgrading {CORE_VENV_DEPS} packages in {context.bin_path}'
)
if sys.platform == 'win32':
python_exe = os.path.join(context.bin_path, 'python.exe')
else:
python_exe = os.path.join(context.bin_path, 'python')
cmd = [python_exe, '-m', 'pip', 'install', '--upgrade']
cmd.extend(CORE_VENV_DEPS)
subprocess.check_call(cmd)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Toggle all file notes Toggle all file annotations