comparison mercurial/utils/procutil.py @ 43657:38387f9e4d22

py3: use native string for 'macosx_app' I couldn't find any definitive information on this, but all examples (except for ours) seem to use a native string. Differential Revision: https://phab.mercurial-scm.org/D7414
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Nov 2019 14:14:11 -0800
parents 47d983f0af65
children 664e24207728
comparison
equal deleted inserted replaced
43656:47d983f0af65 43657:38387f9e4d22
279 hg = encoding.environ.get(b'HG') 279 hg = encoding.environ.get(b'HG')
280 mainmod = sys.modules['__main__'] 280 mainmod = sys.modules['__main__']
281 if hg: 281 if hg:
282 _sethgexecutable(hg) 282 _sethgexecutable(hg)
283 elif mainfrozen(): 283 elif mainfrozen():
284 if getattr(sys, 'frozen', None) == b'macosx_app': 284 if getattr(sys, 'frozen', None) == 'macosx_app':
285 # Env variable set by py2app 285 # Env variable set by py2app
286 _sethgexecutable(encoding.environ[b'EXECUTABLEPATH']) 286 _sethgexecutable(encoding.environ[b'EXECUTABLEPATH'])
287 else: 287 else:
288 _sethgexecutable(pycompat.sysexecutable) 288 _sethgexecutable(pycompat.sysexecutable)
289 elif ( 289 elif (
455 This is different from hgexecutable() because on Windows we want 455 This is different from hgexecutable() because on Windows we want
456 to avoid things opening new shell windows like batch files, so we 456 to avoid things opening new shell windows like batch files, so we
457 get either the python call or current executable. 457 get either the python call or current executable.
458 """ 458 """
459 if mainfrozen(): 459 if mainfrozen():
460 if getattr(sys, 'frozen', None) == b'macosx_app': 460 if getattr(sys, 'frozen', None) == 'macosx_app':
461 # Env variable set by py2app 461 # Env variable set by py2app
462 return [encoding.environ[b'EXECUTABLEPATH']] 462 return [encoding.environ[b'EXECUTABLEPATH']]
463 else: 463 else:
464 return [pycompat.sysexecutable] 464 return [pycompat.sysexecutable]
465 return _gethgcmd() 465 return _gethgcmd()