mercurial/demandimport.py
changeset 28175 c25e3fd38ff1
parent 27537 ffb1ab1e4bba
child 28176 9ff7261cc0f5
equal deleted inserted replaced
28174:f16b84b1e40e 28175:c25e3fd38ff1
   172             If the symbol doesn't exist in the parent module, it must be a
   172             If the symbol doesn't exist in the parent module, it must be a
   173             module. We set missing modules up as _demandmod instances.
   173             module. We set missing modules up as _demandmod instances.
   174             """
   174             """
   175             symbol = getattr(mod, attr, nothing)
   175             symbol = getattr(mod, attr, nothing)
   176             if symbol is nothing:
   176             if symbol is nothing:
   177                 symbol = _demandmod(attr, mod.__dict__, locals, level=1)
   177                 mn = '%s.%s' % (mod.__name__, attr)
       
   178                 if mn in ignore:
       
   179                     importfunc = _origimport
       
   180                 else:
       
   181                     importfunc = _demandmod
       
   182                 symbol = importfunc(attr, mod.__dict__, locals, level=1)
   178                 setattr(mod, attr, symbol)
   183                 setattr(mod, attr, symbol)
   179 
   184 
   180             # Record the importing module references this symbol so we can
   185             # Record the importing module references this symbol so we can
   181             # replace the symbol with the actual module instance at load
   186             # replace the symbol with the actual module instance at load
   182             # time.
   187             # time.