Skip to content

Commit e3afbc9

Browse files
committed
venv: also install the versioned launchers
Like on Linux we provide python3.x globally, so make sure those also exist in the venv, so when python3.x is run the venv version is launched and not the global one.
1 parent e719663 commit e3afbc9

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

Lib/venv/__init__.py

Lines changed: 11 additions & 1 deletion
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:
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.

0 commit comments

Comments
 (0)