]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216)
authorIan Norton <inorton@gmail.com>
Wed, 19 May 2021 09:37:17 +0000 (10:37 +0100)
committerGitHub <noreply@github.com>
Wed, 19 May 2021 09:37:17 +0000 (02:37 -0700)
Automerge-Triggered-By: GH:vsajip
Lib/venv/__init__.py

index 8009deb3ea700341bb65e1a84a7838bd80dad852..b007e25f7ea2cce265f779d1c62efca6a8a26fb6 100644 (file)
@@ -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)