# HG changeset patch # User Pierre-Yves David # Date 1625840321 -7200 # Node ID 2b2f5cf979c34ea0916d6a08fc46bc62b4e28848 # Parent 75b623801f6aac2e9fa984ff4e22fb8eb71544c0 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 diff -r 75b623801f6a -r 2b2f5cf979c3 tests/run-tests.py --- 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