comparison tests/run-tests.py @ 47494:81d70de39c7e

run-tests: unroll a non-so-one-liner This is shorter and clearer. Differential Revision: https://phab.mercurial-scm.org/D10938
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 02 Jul 2021 22:48:35 +0200
parents 7ea39d633cf3
children 38f00245edb3
comparison
equal deleted inserted replaced
47493:2dac94edd98d 47494:81d70de39c7e
3532 pyexename = sys.platform == 'win32' and b'python.exe' or b'python3' 3532 pyexename = sys.platform == 'win32' and b'python.exe' or b'python3'
3533 3533
3534 # os.symlink() is a thing with py3 on Windows, but it requires 3534 # os.symlink() is a thing with py3 on Windows, but it requires
3535 # Administrator rights. 3535 # Administrator rights.
3536 if getattr(os, 'symlink', None) and os.name != 'nt': 3536 if getattr(os, 'symlink', None) and os.name != 'nt':
3537 vlog( 3537 msg = "# Making python executable in test path a symlink to '%s'"
3538 "# Making python executable in test path a symlink to '%s'" 3538 msg %= sysexecutable
3539 % sysexecutable 3539 vlog(msg)
3540 )
3541 mypython = os.path.join(self._tmpbindir, pyexename) 3540 mypython = os.path.join(self._tmpbindir, pyexename)
3542 try: 3541 try:
3543 if os.readlink(mypython) == sysexecutable: 3542 if os.readlink(mypython) == sysexecutable:
3544 return 3543 return
3545 os.unlink(mypython) 3544 os.unlink(mypython)