changeset 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 713e984bec91
children 2abba5068aa1
files mercurial/util.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Sun Mar 19 01:38:10 2017 -0400
+++ b/mercurial/util.py	Sun Mar 19 01:19:27 2017 -0400
@@ -969,7 +969,7 @@
     """
     if _hgexecutable is None:
         hg = encoding.environ.get('HG')
-        mainmod = sys.modules['__main__']
+        mainmod = sys.modules[pycompat.sysstr('__main__')]
         if hg:
             _sethgexecutable(hg)
         elif mainfrozen():