From: Ian Norton Date: Wed, 19 May 2021 09:37:17 +0000 (+0100) Subject: bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) X-Git-Tag: v3.11.0a1~1085 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d6e463df4c44d2601f88b6bb01f15384c9d0ff8;p=thirdparty%2FPython%2Fcpython.git bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) Automerge-Triggered-By: GH:vsajip --- diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index 8009deb3ea70..b007e25f7ea2 100644 --- a/Lib/venv/__init__.py +++ b/Lib/venv/__init__.py @@ -267,8 +267,9 @@ class EnvBuilder: os.path.normcase(f).startswith(('python', 'vcruntime')) ] else: - suffixes = ['python.exe', 'python_d.exe', 'pythonw.exe', - 'pythonw_d.exe'] + suffixes = {'python.exe', 'python_d.exe', 'pythonw.exe', 'pythonw_d.exe'} + base_exe = os.path.basename(context.env_exe) + suffixes.add(base_exe) for suffix in suffixes: src = os.path.join(dirname, suffix)