# HG changeset patch # User Martin von Zweigbergk # Date 2019-09-05 23:32:33 # Node ID acf80f9edc85633abf1b3ed6f94e569e0faf7bfe # Parent 3bed541aa65da16ac0b0cb4dcf7e388f875a8ced py3: drop incorrect fsencode(findexe(...)) in procutil I recently added the bad call, thinking that findexe() was a standard library function returning a string result, but it's actually our own function returning bytes. Thanks to Yuya for noticing. Differential Revision: https://phab.mercurial-scm.org/D6826 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 @@ def hgexecutable(): 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):