diff tests/run-tests.py @ 52732:fa5a0c2b9f04

run-tests: fix _python for --local `py -3.9 run-tests.py --local` was broken on default (`ModuleNotFoundError` for `mercurial`). see https://foss.heptapod.net/mercurial/mercurial-devel/-/merge_requests/1207#note_379493
author Pierre Augier <pierre.augier@univ-grenoble-alpes.fr>
date Fri, 24 Jan 2025 23:06:59 +0100
parents ba8aa20ff31f
children e465689fa74d
line wrap: on
line diff
--- a/tests/run-tests.py	Wed Jan 29 18:56:20 2025 +0100
+++ b/tests/run-tests.py	Fri Jan 24 23:06:59 2025 +0100
@@ -3291,10 +3291,9 @@
                     self._pythondir = get_site_packages_dir(python_exe)
                 except (FileNotFoundError, subprocess.CalledProcessError):
                     self._pythondir = self._bindir
-            elif self.options.local:
-                assert WINDOWS
-                python_exe = os.path.join(self._bindir, b"python.exe")
-                self._pythondir = get_site_packages_dir(python_exe)
+                if self.options.local:
+                    self._python = _bytes2sys(python_exe)
+
             # If it looks like our in-repo Rust binary, use the source root.
             # This is a bit hacky. But rhg is still not supported outside the
             # source directory. So until it is, do the simple thing.