run-tests: setup "correct" python earlier
I don't see any good reason to wait. This result in slightly simpler code.
Differential Revision: https://phab.mercurial-scm.org/D11047
--- a/tests/run-tests.py Fri Jul 09 16:28:45 2021 +0200
+++ b/tests/run-tests.py Fri Jul 09 17:02:01 2021 +0200
@@ -3419,11 +3419,10 @@
if self.options.list_tests:
result = runner.listtests(suite)
else:
+ self._usecorrectpython()
if self._installdir:
self._installhg()
self._checkhglib("Testing")
- else:
- self._usecorrectpython()
if self.options.chg:
assert self._installdir
self._installchg()
@@ -3705,8 +3704,6 @@
sys.exit(1)
os.chdir(self._testdir)
- self._usecorrectpython()
-
hgbat = os.path.join(self._bindir, b'hg.bat')
if os.path.isfile(hgbat):
# hg.bat expects to be put in bin/scripts while run-tests.py