diff --git a/earwigbot/lazy.py b/earwigbot/lazy.py index f9214e0..b123e3c 100644 --- a/earwigbot/lazy.py +++ b/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()