demandimport: omit default value of "level" at construction of _demandmod
This makes construction of _demandmod require explicit level value,
and helps to avoid issues like
issue5208 in the future.
--- a/mercurial/demandimport.py Sat Aug 06 22:24:33 2016 +0900
+++ b/mercurial/demandimport.py Sat Aug 06 22:24:33 2016 +0900
@@ -64,8 +64,12 @@
return importfunc(hgextname, globals, *args, **kwargs)
class _demandmod(object):
- """module demand-loader and proxy"""
- def __init__(self, name, globals, locals, level=level):
+ """module demand-loader and proxy
+
+ Specify 1 as 'level' argument at construction, to import module
+ relatively.
+ """
+ def __init__(self, name, globals, locals, level):
if '.' in name:
head, rest = name.split('.', 1)
after = [rest]