summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorIan Norton <inorton@gmail.com>2021-05-19 09:37:17 (GMT)
committerGitHub <noreply@github.com>2021-05-19 09:37:17 (GMT)
commit5d6e463df4c44d2601f88b6bb01f15384c9d0ff8 (patch)
treeda13c4af6bb45ac4db2ac8750560a0e4c7bd47bd /Lib/venv
parent60d343a81679ea90ae0e08fadcd132c16906a51a (diff)
downloadcpython-5d6e463df4c44d2601f88b6bb01f15384c9d0ff8.zip
cpython-5d6e463df4c44d2601f88b6bb01f15384c9d0ff8.tar.gz
cpython-5d6e463df4c44d2601f88b6bb01f15384c9d0ff8.tar.bz2
bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216)
Automerge-Triggered-By: GH:vsajip
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 8009deb..b007e25 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)