--- a/mercurial/demandimport.py Mon Jun 18 17:49:56 2007 -0500
+++ b/mercurial/demandimport.py Mon Jun 18 19:43:26 2007 -0500
@@ -61,7 +61,10 @@
if locals and locals.get(head) == self:
locals[head] = mod
object.__setattr__(self, "_module", mod)
+
def __repr__(self):
+ if self._module:
+ return "<proxied module '%s'>" % self._data[0]
return "<unloaded module '%s'>" % self._data[0]
def __call__(self, *args, **kwargs):
raise TypeError("'unloaded module' object is not callable")
@@ -102,7 +105,7 @@
for x in fromlist:
# set requested submodules for demand load
if not(hasattr(mod, x)):
- setattr(mod, x, _demandmod(x, mod.__dict__, mod.__dict__))
+ setattr(mod, x, _demandmod(x, mod.__dict__, locals))
return mod
ignore = ['_hashlib', '_xmlplus', 'fcntl', 'win32com.gen_py']