comparison mercurial/utils/procutil.py @ 42883:acf80f9edc85

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
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 05 Sep 2019 16:32:33 -0700
parents db51a4ac85ac
children 2cc453284d5c
comparison
equal deleted inserted replaced
42882:3bed541aa65d 42883:acf80f9edc85
243 _sethgexecutable(pycompat.sysexecutable) 243 _sethgexecutable(pycompat.sysexecutable)
244 elif (not pycompat.iswindows and os.path.basename( 244 elif (not pycompat.iswindows and os.path.basename(
245 pycompat.fsencode(getattr(mainmod, '__file__', ''))) == 'hg'): 245 pycompat.fsencode(getattr(mainmod, '__file__', ''))) == 'hg'):
246 _sethgexecutable(pycompat.fsencode(mainmod.__file__)) 246 _sethgexecutable(pycompat.fsencode(mainmod.__file__))
247 else: 247 else:
248 exe = findexe('hg') 248 _sethgexecutable(findexe('hg') or
249 if exe: 249 os.path.basename(pycompat.sysargv[0]))
250 _sethgexecutable(pycompat.fsencode(exe))
251 else:
252 _sethgexecutable(os.path.basename(pycompat.sysargv[0]))
253 return _hgexecutable 250 return _hgexecutable
254 251
255 def _sethgexecutable(path): 252 def _sethgexecutable(path):
256 """set location of the 'hg' executable""" 253 """set location of the 'hg' executable"""
257 global _hgexecutable 254 global _hgexecutable