]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 Dec 2021 18:06:07 +0000 (10:06 -0800)
committerGitHub <noreply@github.com>
Fri, 10 Dec 2021 18:06:07 +0000 (18:06 +0000)
Co-authored-by: Ian Norton <inorton@gmail.com>
Lib/venv/__init__.py

index ce1f5d710ad76889458cb18f365cfda538ea1f50..6f1af294ae63e367967cd1e655cbd6118bae5b24 100644 (file)
@@ -281,8 +281,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)