Skip to content

Commit cec1084

Browse files
committed
venv: install more launchers and batch scripts
1 parent 5248fde commit cec1084

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Lib/venv/__init__.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import types
1414
import shlex
1515

16-
from sysconfig import _POSIX_BUILD
1716

1817
CORE_VENV_DEPS = ('pip',)
1918
logger = logging.getLogger(__name__)
@@ -331,7 +330,7 @@ def setup_python(self, context):
331330
if not os.path.islink(path):
332331
os.chmod(path, 0o755)
333332
else:
334-
if self.symlinks and not _POSIX_BUILD:
333+
if self.symlinks:
335334
# For symlinking, we need a complete copy of the root directory
336335
# If symlinks fail, you'll get unnecessary copies of files, but
337336
# we assume that if you've opted into symlinks on Windows then
@@ -346,7 +345,7 @@ def setup_python(self, context):
346345
os.path.normcase(f).startswith(('python', 'vcruntime'))
347346
]
348347
else:
349-
suffixes = {'python.exe', 'python_d.exe', 'pythonw.exe', 'pythonw_d.exe'}
348+
suffixes = {'python.exe', 'python_d.exe', 'pythonw.exe', 'pythonw_d.exe', 'python3.exe', 'python3w.exe', 'python%d.%d.exe' % sys.version_info[:2]}
350349
base_exe = os.path.basename(context.env_exe)
351350
suffixes.add(base_exe)
352351

@@ -355,12 +354,6 @@ def setup_python(self, context):
355354
if os.path.lexists(src):
356355
copier(src, os.path.join(binpath, suffix))
357356

358-
if _POSIX_BUILD:
359-
# copy from python/pythonw so the venvlauncher magic in symlink_or_copy triggers
360-
copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python3.exe'))
361-
copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python%d.%d.exe' % sys.version_info[:2]))
362-
copier(os.path.join(dirname, 'pythonw.exe'), os.path.join(binpath, 'python3w.exe'))
363-
364357
if sysconfig.is_python_build():
365358
# copy init.tcl
366359
for root, dirs, files in os.walk(context.python_dir):
@@ -385,7 +378,6 @@ def _call_new_python(self, context, *py_args, **kwargs):
385378
env['VIRTUAL_ENV'] = context.env_dir
386379
env.pop('PYTHONHOME', None)
387380
env.pop('PYTHONPATH', None)
388-
env.pop("MSYSTEM", None)
389381
kwargs['cwd'] = context.env_dir
390382
kwargs['executable'] = context.env_exec_cmd
391383
subprocess.check_output(args, **kwargs)

Makefile.pre.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,9 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
20252025
$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \
20262026
$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(EXE); \
20272027
$(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/pythonw$(EXE); \
2028+
$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python3$(EXE); \
2029+
$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(VERSION)$(EXE); \
2030+
$(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python3w$(EXE); \
20282031
else \
20292032
$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
20302033
fi
@@ -2174,7 +2177,7 @@ LIBSUBDIRS= asyncio \
21742177
msilib \
21752178
unittest \
21762179
urllib \
2177-
venv venv/scripts venv/scripts/common venv/scripts/posix \
2180+
venv venv/scripts venv/scripts/common venv/scripts/nt venv/scripts/posix \
21782181
wsgiref \
21792182
$(XMLLIBSUBDIRS) \
21802183
xmlrpc \

0 commit comments

Comments
 (0)