Commits

Marc Abramowitz committed 98c4000

MovedModule.__getattr__: Set attribute on the lazy module, so __getattr__ isn't
invoked multiple times.

  • Participants
  • Parent commits 4e2818b
  • Branches issue_19

Comments (0)

Files changed (1)

 
     def __getattr__(self, attr):
         _module = self._resolve()
-        return getattr(_module, attr)
+        value = getattr(_module, attr)
+        setattr(self, attr, value)
+        return value
 
 
 class _LazyModule(types.ModuleType):