MINGW-packages/mingw-w64-python3.13/0178-restore-versioned-launchers-in-venv-cleanup.patch
2025-09-14 11:03:52 +02:00

42 lines
1.8 KiB
Diff

From c6263a43cc719a507632c005a75fe065c5c0501d Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 13 Sep 2025 15:27:31 +0200
Subject: [PATCH 178/N] restore versioned launchers in venv + cleanup
---
Lib/venv/__init__.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 79a5fdf..e85c1e1 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -376,8 +376,18 @@ class EnvBuilder:
f'pythonw{exe_t}{exe_d}.exe': pythonw_exe,
}
+ if sys._is_mingw:
+ for key, value in list(link_sources.items()):
+ if key.startswith('python'):
+ link_sources[key.replace('python', 'python3')] = value
+ link_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value
+ for key, value in list(copy_sources.items()):
+ if key.startswith('python'):
+ copy_sources[key.replace('python', 'python3')] = value
+ copy_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value
+
do_copies = True
- if self.symlinks and not 'mingw' in sys.version.lower():
+ if self.symlinks and not sys._is_mingw:
do_copies = False
# For symlinking, we need all the DLLs to be available alongside
# the executables.
@@ -437,7 +447,6 @@ class EnvBuilder:
env['VIRTUAL_ENV'] = context.env_dir
env.pop('PYTHONHOME', None)
env.pop('PYTHONPATH', None)
- env.pop("MSYSTEM", None)
kwargs['cwd'] = context.env_dir
kwargs['executable'] = context.env_exec_cmd
subprocess.check_output(args, **kwargs)