From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 10 Dec 2021 18:06:07 +0000 (-0800) Subject: [3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216... X-Git-Tag: v3.9.10~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bad16f0cf71a6b11ef62f86be6b3d3567cd70a16;p=thirdparty%2FPython%2Fcpython.git [3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30033) Co-authored-by: Ian Norton --- diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index ce1f5d710ad7..6f1af294ae63 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)