From bb8d645f3a09645686cf8f66bd46dcfa4efac713 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 10 Dec 2021 09:51:42 -0800 Subject: [3.10] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30034) Co-authored-by: Ian Norton --- Lib/venv/__init__.py | 5 +++-- 1 file 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) -- cgit v0.12