Sfoglia il codice sorgente

Ensure lazy-loading works with subpackages.

tags/v0.2
Ben Kurtovic 12 anni fa
parent
commit
d0217d7b87
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. +2
    -0
      earwigbot/lazy.py

+ 2
- 0
earwigbot/lazy.py Vedi File

@@ -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()


Caricamento…
Annulla
Salva