comparison mercurial/util.py @ 31539:28f00d07e2ee

util: reference __main__ in sys.modules as a sysstr
author Augie Fackler <augie@google.com>
date Sun, 19 Mar 2017 01:19:27 -0400
parents 670166e0fcaa
children 52361c4f4dac
comparison
equal deleted inserted replaced
31538:713e984bec91 31539:28f00d07e2ee
967 967
968 Defaults to $HG or 'hg' in the search path. 968 Defaults to $HG or 'hg' in the search path.
969 """ 969 """
970 if _hgexecutable is None: 970 if _hgexecutable is None:
971 hg = encoding.environ.get('HG') 971 hg = encoding.environ.get('HG')
972 mainmod = sys.modules['__main__'] 972 mainmod = sys.modules[pycompat.sysstr('__main__')]
973 if hg: 973 if hg:
974 _sethgexecutable(hg) 974 _sethgexecutable(hg)
975 elif mainfrozen(): 975 elif mainfrozen():
976 if getattr(sys, 'frozen', None) == 'macosx_app': 976 if getattr(sys, 'frozen', None) == 'macosx_app':
977 # Env variable set by py2app 977 # Env variable set by py2app