mercurial/demandimport.py
changeset 4626 eb99af2d845e
parent 4126 b9dcee25be8e
child 4631 e3afa670e484
--- a/mercurial/demandimport.py	Mon Jun 18 12:39:43 2007 -0700
+++ b/mercurial/demandimport.py	Mon Jun 18 15:03:55 2007 -0700
@@ -96,6 +96,8 @@
         mod = _origimport(name, globals, locals)
         # recurse down the module chain
         for comp in name.split('.')[1:]:
+            if not hasattr(mod, comp):
+                setattr(mod, comp, _demandmod(comp, mod.__dict__, mod.__dict__))
             mod = getattr(mod, comp)
         for x in fromlist:
             # set requested submodules for demand load