demandimport: omit default value of "level" at construction of _demandmod
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sat, 06 Aug 2016 22:24:33 +0900
changeset 29737 ae9a4d6a8d51
parent 29736 14f077f7519a
child 29738 c1696430254f
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.
mercurial/demandimport.py
--- 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]