瀏覽代碼

Ensure lazy-loading works with subpackages.

tags/v0.2
Ben Kurtovic 12 年之前
父節點
當前提交
d0217d7b87
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. +2
    -0
      earwigbot/lazy.py

+ 2
- 0
earwigbot/lazy.py 查看文件

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


Loading…
取消
儲存