Skip to content

Commit 8c9aa4b

Browse files
inortonmiss-islington
authored andcommitted
bpo-43749: Ensure current exe is copied when using venv on windows (pythonGH-25216)
Automerge-Triggered-By: GH:vsajip (cherry picked from commit 5d6e463) Co-authored-by: Ian Norton <inorton@gmail.com>
1 parent bb76410 commit 8c9aa4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/venv/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ def setup_python(self, context):
281281
os.path.normcase(f).startswith(('python', 'vcruntime'))
282282
]
283283
else:
284-
suffixes = ['python.exe', 'python_d.exe', 'pythonw.exe',
285-
'pythonw_d.exe']
284+
suffixes = {'python.exe', 'python_d.exe', 'pythonw.exe', 'pythonw_d.exe'}
285+
base_exe = os.path.basename(context.env_exe)
286+
suffixes.add(base_exe)
286287

287288
for suffix in suffixes:
288289
src = os.path.join(dirname, suffix)

0 commit comments

Comments
 (0)