changeset 47574:2b2f5cf979c3

run-tests: explicitly track that `pythondir` was inferred If we want to know that something happened, we should simply track that this things happened. This will be useful to start using `tmpbindir` more in a different form. Differential Revision: https://phab.mercurial-scm.org/D11043
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 09 Jul 2021 16:18:41 +0200
parents 75b623801f6a
children 27fb9f32e1a3
files tests/run-tests.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Fri Jul 09 15:39:43 2021 +0200
+++ b/tests/run-tests.py	Fri Jul 09 16:18:41 2021 +0200
@@ -3023,6 +3023,8 @@
         self._bindir = None
         self._tmpbindir = None
         self._pythondir = None
+        # True if we had to infer the pythondir from --with-hg
+        self._pythondir_inferred = False
         self._coveragefile = None
         self._createdfiles = []
         self._hgcommand = None
@@ -3139,6 +3141,7 @@
             # Fall back to the legacy behavior.
             else:
                 self._pythondir = self._bindir
+            self._pythondir_inferred = True
 
         else:
             self._installdir = os.path.join(self._hgtmp, b"install")
@@ -3740,9 +3743,7 @@
     def _checkhglib(self, verb):
         """Ensure that the 'mercurial' package imported by python is
         the one we expect it to be.  If not, print a warning to stderr."""
-        if (self._bindir == self._pythondir) and (
-            self._bindir != self._tmpbindir
-        ):
+        if self._pythondir_inferred:
             # The pythondir has been inferred from --with-hg flag.
             # We cannot expect anything sensible here.
             return