1313import types
1414import shlex
1515
16- from sysconfig import _POSIX_BUILD
1716
1817CORE_VENV_DEPS = ('pip' ,)
1918logger = 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 )
0 commit comments