mercurial/util.py
changeset 31533 28f00d07e2ee
parent 31496 670166e0fcaa
child 31539 52361c4f4dac
--- 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():