hgdemandimport/demandimportpy2.py
changeset 32447 252d2260c74e
parent 32446 63365e9621d6
child 32448 91a2ec8e7fa0
--- a/hgdemandimport/demandimportpy2.py	Mon May 01 14:26:56 2017 +0900
+++ b/hgdemandimport/demandimportpy2.py	Fri Apr 28 23:46:16 2017 +0900
@@ -132,8 +132,11 @@
                 subload(mod, x)
 
             # Replace references to this proxy instance with the actual module.
-            if locals and locals.get(head) is self:
-                locals[head] = mod
+            if locals:
+                if locals.get(head) is self:
+                    locals[head] = mod
+                elif locals.get(head + r'mod') is self:
+                    locals[head + r'mod'] = mod
 
             for modname in modrefs:
                 modref = sys.modules.get(modname, None)