bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216)

Automerge-Triggered-By: GH:vsajip
This commit is contained in:
Ian Norton 2021-05-19 10:37:17 +01:00 committed by GitHub
parent 60d343a816
commit 5d6e463df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View 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)