summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-12-10 18:06:07 (GMT)
committerGitHub <noreply@github.com>2021-12-10 18:06:07 (GMT)
commitbad16f0cf71a6b11ef62f86be6b3d3567cd70a16 (patch)
treed14e3446b23f75aab1a361c13897c58193512186
parent040f9f9c48f4e74e851d850275aa9e050a04d0c6 (diff)
downloadcpython-bad16f0cf71a6b11ef62f86be6b3d3567cd70a16.zip
cpython-bad16f0cf71a6b11ef62f86be6b3d3567cd70a16.tar.gz
cpython-bad16f0cf71a6b11ef62f86be6b3d3567cd70a16.tar.bz2
[3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30033)
Co-authored-by: Ian Norton <inorton@gmail.com>
-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 ce1f5d7..6f1af29 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -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)