hgdemandimport/demandimportpy2.py
changeset 43554 9f70512ae2cf
parent 43551 313e3a279828
child 43807 be8552f25cab
equal deleted inserted replaced
43553:47fac1692ede 43554:9f70512ae2cf
   133                 # Replace references to this proxy instance with the
   133                 # Replace references to this proxy instance with the
   134                 # actual module.
   134                 # actual module.
   135                 if locals:
   135                 if locals:
   136                     if locals.get(head) is self:
   136                     if locals.get(head) is self:
   137                         locals[head] = mod
   137                         locals[head] = mod
   138                     elif locals.get(head + r'mod') is self:
   138                     elif locals.get(head + 'mod') is self:
   139                         locals[head + r'mod'] = mod
   139                         locals[head + 'mod'] = mod
   140 
   140 
   141                 for modname in modrefs:
   141                 for modname in modrefs:
   142                     modref = sys.modules.get(modname, None)
   142                     modref = sys.modules.get(modname, None)
   143                     if modref and getattr(modref, head, None) is self:
   143                     if modref and getattr(modref, head, None) is self:
   144                         setattr(modref, head, mod)
   144                         setattr(modref, head, mod)