Explorar el Código

Ensure lazy-loading works with subpackages.

tags/v0.2
Ben Kurtovic hace 11 años
padre
commit
d0217d7b87
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. +2
    -0
      earwigbot/lazy.py

+ 2
- 0
earwigbot/lazy.py Ver fichero

@@ -60,6 +60,8 @@ class _LazyModule(type):
parents = (ModuleType,)
klass = type.__new__(cls, "module", parents, attributes)
sys.modules[name] = klass(name)
if "." in name: # Also ensure the parent exists
_LazyModule(name.rsplit(".", 1)[0])
return sys.modules[name]
finally:
release_lock()


Cargando…
Cancelar
Guardar