Comments
Patch
@@ -18,6 +18,7 @@ from .i18n import (
from . import (
cmdutil,
error,
+ pycompat,
util,
)
@@ -57,8 +58,9 @@ def find(name):
return mod
def loadpath(path, module_name):
- module_name = module_name.replace('.', '_')
+ module_name = module_name.replace(r'.', r'_')
path = util.normpath(util.expandpath(path))
+ path = os.fsdecode(path)
if os.path.isdir(path):
# module/__init__.py style
d, f = os.path.split(path)
@@ -85,7 +87,7 @@ def _importext(name, path=None, reportfu
# the module will be loaded in sys.modules
# choose an unique name so that it doesn't
# conflicts with other modules
- mod = loadpath(path, 'hgext.%s' % name)
+ mod = loadpath(path, pycompat.sysstr('hgext.%s' % name))
else:
try:
mod = _importh("hgext.%s" % name)