mercurial/hook.py
changeset 36108 c4146cf4dd20
parent 35357 056a9c8813aa
child 36841 9c636ec1ef37
--- a/mercurial/hook.py	Sun Feb 11 15:58:31 2018 -0800
+++ b/mercurial/hook.py	Sun Feb 11 16:02:32 2018 -0800
@@ -49,12 +49,12 @@
                 modname = modfile
         with demandimport.deactivated():
             try:
-                obj = __import__(modname)
+                obj = __import__(pycompat.sysstr(modname))
             except (ImportError, SyntaxError):
                 e1 = sys.exc_info()
                 try:
                     # extensions are loaded with hgext_ prefix
-                    obj = __import__("hgext_%s" % modname)
+                    obj = __import__(r"hgext_%s" % pycompat.sysstr(modname))
                 except (ImportError, SyntaxError):
                     e2 = sys.exc_info()
                     if ui.tracebackflag: