Skip to content

Commit c6263a4

Browse files
committed
restore versioned launchers in venv + cleanup
1 parent f50419a commit c6263a4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Lib/venv/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,18 @@ def setup_python(self, context):
376376
f'pythonw{exe_t}{exe_d}.exe': pythonw_exe,
377377
}
378378

379+
if sys._is_mingw:
380+
for key, value in list(link_sources.items()):
381+
if key.startswith('python'):
382+
link_sources[key.replace('python', 'python3')] = value
383+
link_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value
384+
for key, value in list(copy_sources.items()):
385+
if key.startswith('python'):
386+
copy_sources[key.replace('python', 'python3')] = value
387+
copy_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value
388+
379389
do_copies = True
380-
if self.symlinks and not 'mingw' in sys.version.lower():
390+
if self.symlinks and not sys._is_mingw:
381391
do_copies = False
382392
# For symlinking, we need all the DLLs to be available alongside
383393
# the executables.
@@ -437,7 +447,6 @@ def _call_new_python(self, context, *py_args, **kwargs):
437447
env['VIRTUAL_ENV'] = context.env_dir
438448
env.pop('PYTHONHOME', None)
439449
env.pop('PYTHONPATH', None)
440-
env.pop("MSYSTEM", None)
441450
kwargs['cwd'] = context.env_dir
442451
kwargs['executable'] = context.env_exec_cmd
443452
subprocess.check_output(args, **kwargs)

0 commit comments

Comments
 (0)