comparison tests/run-tests.py @ 48866:2ccd5e71bcd3

tests: remove last references to PYTHON3 This removes the last references to PYTHON3. Differential Revision: https://phab.mercurial-scm.org/D12244
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 20 Feb 2022 13:27:38 -0700
parents 7caa967bb7b6
children f547a5dee234
comparison
equal deleted inserted replaced
48865:7caa967bb7b6 48866:2ccd5e71bcd3
161 '%s is only supported on Python 3.5+, not %s' 161 '%s is only supported on Python 3.5+, not %s'
162 % (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3])) 162 % (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3]))
163 ) 163 )
164 sys.exit(70) # EX_SOFTWARE from `man 3 sysexit` 164 sys.exit(70) # EX_SOFTWARE from `man 3 sysexit`
165 165
166 PYTHON3 = True
167 xrange = range # we use xrange in one place, and we'd rather not use range 166 xrange = range # we use xrange in one place, and we'd rather not use range
168 167
169 168
170 def _sys2bytes(p): 169 def _sys2bytes(p):
171 if p is None: 170 if p is None:
1462 env['LOCALIP'] = _bytes2sys(self._localip()) 1461 env['LOCALIP'] = _bytes2sys(self._localip())
1463 1462
1464 # This has the same effect as Py_LegacyWindowsStdioFlag in exewrapper.c, 1463 # This has the same effect as Py_LegacyWindowsStdioFlag in exewrapper.c,
1465 # but this is needed for testing python instances like dummyssh, 1464 # but this is needed for testing python instances like dummyssh,
1466 # dummysmtpd.py, and dumbhttp.py. 1465 # dummysmtpd.py, and dumbhttp.py.
1467 if PYTHON3 and WINDOWS: 1466 if WINDOWS:
1468 env['PYTHONLEGACYWINDOWSSTDIO'] = '1' 1467 env['PYTHONLEGACYWINDOWSSTDIO'] = '1'
1469 1468
1470 # Modified HOME in test environment can confuse Rust tools. So set 1469 # Modified HOME in test environment can confuse Rust tools. So set
1471 # CARGO_HOME and RUSTUP_HOME automatically if a Rust toolchain is 1470 # CARGO_HOME and RUSTUP_HOME automatically if a Rust toolchain is
1472 # present and these variables aren't already defined. 1471 # present and these variables aren't already defined.
3412 3411
3413 jobs = min(num_tests, self.options.jobs) 3412 jobs = min(num_tests, self.options.jobs)
3414 3413
3415 failed = False 3414 failed = False
3416 kws = self.options.keywords 3415 kws = self.options.keywords
3417 if kws is not None and PYTHON3: 3416 if kws is not None:
3418 kws = kws.encode('utf-8') 3417 kws = kws.encode('utf-8')
3419 3418
3420 suite = TestSuite( 3419 suite = TestSuite(
3421 self._testdir, 3420 self._testdir,
3422 jobs=jobs, 3421 jobs=jobs,