Patchwork D8674: run-tests: find python binary on Python 3 (issue6361)

login
register
mail settings
Submitter phabricator
Date July 1, 2020, 1:48 p.m.
Message ID <differential-rev-PHID-DREV-xr4bwtzgf7hxxh63r72n-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46605/
State Superseded
Headers show

Comments

phabricator - July 1, 2020, 1:48 p.m.
pike created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Return strings from _findprogram as all callers expect
  unicode strings.
  Previously the check in _usecorrectpython agains sysexecutable
  was always false on Python 3.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D8674

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




To: pike, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -3681,7 +3681,7 @@ 
         for p in osenvironb.get(b'PATH', dpb).split(sepb):
             name = os.path.join(p, program)
             if os.name == 'nt' or os.access(name, os.X_OK):
-                return name
+                return _bytes2sys(name)
         return None
 
     def _checktools(self):
@@ -3692,7 +3692,7 @@ 
             found = self._findprogram(p)
             p = p.decode("utf-8")
             if found:
-                vlog("# Found prerequisite", p, "at", _bytes2sys(found))
+                vlog("# Found prerequisite", p, "at", found)
             else:
                 print("WARNING: Did not find prerequisite tool: %s " % p)