# HG changeset patch # User FUJIWARA Katsunori # Date 2016-08-06 13:24:33 # Node ID ae9a4d6a8d5132a3b00e4bfee67d33bfb0b09368 # Parent 14f077f7519afb623dbfad37b411b2356f325fb3 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. diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py --- a/mercurial/demandimport.py +++ b/mercurial/demandimport.py @@ -64,8 +64,12 @@ def _hgextimport(importfunc, name, globa 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]