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) |