diff mercurial/extensions.py @ 30575:c4c51fd0e11d

py3: use pycompat.sysstr() in __import__() __import__() on Python 3 accepts strings which are different from that of Python 2. Used pycompat.sysstr() to get string accordingly.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 01 Dec 2016 13:12:04 +0530
parents 5581b294f3c6
children 5ffbaba9acac
line wrap: on
line diff
--- a/mercurial/extensions.py	Wed Nov 30 23:51:11 2016 +0530
+++ b/mercurial/extensions.py	Thu Dec 01 13:12:04 2016 +0530
@@ -18,6 +18,7 @@
 from . import (
     cmdutil,
     error,
+    pycompat,
     util,
 )
 
@@ -74,7 +75,7 @@
 
 def _importh(name):
     """import and return the <name> module"""
-    mod = __import__(name)
+    mod = __import__(pycompat.sysstr(name))
     components = name.split('.')
     for comp in components[1:]:
         mod = getattr(mod, comp)