Patchwork D6826: py3: drop incorrect fsencode(findexe(...)) in procutil

login
register
mail settings
Submitter phabricator
Date Sept. 7, 2019, 5:22 p.m.
Message ID <245b4cfb633df04c814f53554e14250c@localhost.localdomain>
Download mbox | patch
Permalink /patch/41558/
State Not Applicable
Headers show

Comments

phabricator - Sept. 7, 2019, 5:22 p.m.
Closed by commit rHGacf80f9edc85: py3: drop incorrect fsencode(findexe(...)) in procutil (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6826?vs=16442&id=16447

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6826/new/

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

AFFECTED FILES
  mercurial/utils/procutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py
+++ b/mercurial/utils/procutil.py
@@ -245,11 +245,8 @@ 
             pycompat.fsencode(getattr(mainmod, '__file__', ''))) == 'hg'):
             _sethgexecutable(pycompat.fsencode(mainmod.__file__))
         else:
-            exe = findexe('hg')
-            if exe:
-                _sethgexecutable(pycompat.fsencode(exe))
-            else:
-                _sethgexecutable(os.path.basename(pycompat.sysargv[0]))
+            _sethgexecutable(findexe('hg') or
+                             os.path.basename(pycompat.sysargv[0]))
     return _hgexecutable
 
 def _sethgexecutable(path):