comparison tests/run-tests.py @ 47576:c3c38eb08465

run-tests: cleanup windows generation of the python / python3 pointeur They are no need to generate then in RUNTESTDIR and we don't need a python2 executable. (because not test ever use `python2` explicitly). This is probably still not perfect, but at least it is better. Differential Revision: https://phab.mercurial-scm.org/D11045
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 09 Jul 2021 16:28:45 +0200
parents 27fb9f32e1a3
children 2ee81806831f
comparison
equal deleted inserted replaced
47575:27fb9f32e1a3 47576:c3c38eb08465
3574 # Windows doesn't have `python3.exe`, and MSYS cannot understand the 3574 # Windows doesn't have `python3.exe`, and MSYS cannot understand the
3575 # reparse point with that name provided by Microsoft. Create a 3575 # reparse point with that name provided by Microsoft. Create a
3576 # simple script on PATH with that name that delegates to the py3 3576 # simple script on PATH with that name that delegates to the py3
3577 # launcher so the shebang lines work. 3577 # launcher so the shebang lines work.
3578 if os.getenv('MSYSTEM'): 3578 if os.getenv('MSYSTEM'):
3579 with open(osenvironb[b'RUNTESTDIR'] + b'/python3', 'wb') as f: 3579 py3exe_name = os.path.join(self._custom_bin_dir, b'python3')
3580 with open(py3exe_name, 'wb') as f:
3580 f.write(b'#!/bin/sh\n') 3581 f.write(b'#!/bin/sh\n')
3581 f.write(b'py -3.%d "$@"\n' % sys.version_info[1]) 3582 f.write(b'py -3.%d "$@"\n' % sys.version_info[1])
3582 if os.getenv('MSYSTEM'): 3583
3583 with open(osenvironb[b'RUNTESTDIR'] + b'/python2', 'wb') as f: 3584 pyexe_name = os.path.join(self._custom_bin_dir, b'python')
3585 with open(pyexe_name, 'wb') as f:
3584 f.write(b'#!/bin/sh\n') 3586 f.write(b'#!/bin/sh\n')
3585 f.write(b'py -2.%d "$@"\n' % sys.version_info[1]) 3587 f.write(b'py -%d.%d "$@"\n' % sys.version_info[0:2])
3586 3588
3587 exedir, exename = os.path.split(sysexecutable) 3589 exedir, exename = os.path.split(sysexecutable)
3588 for pyexename in pyexe_names: 3590 for pyexename in pyexe_names:
3589 msg = "# Modifying search path to find %s as %s in '%s'" 3591 msg = "# Modifying search path to find %s as %s in '%s'"
3590 msg %= (exename, pyexename, exedir) 3592 msg %= (exename, pyexename, exedir)