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
--- a/mercurial/utils/procutil.py Sat Sep 07 10:08:47 2019 -0700
+++ b/mercurial/utils/procutil.py Thu Sep 05 16:32:33 2019 -0700
@@ -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):