diff --git a/zenoh/__init__.py b/zenoh/__init__.py index 0d5b6844..b59d6f3e 100644 --- a/zenoh/__init__.py +++ b/zenoh/__init__.py @@ -13,18 +13,15 @@ # from .zenoh import * -try: - from . import ext -except ImportError: - pass -try: - from . import shm -except ImportError: - pass - def __getattr__(name): if name == "ext": import zenoh.ext + + return zenoh.ext elif name == "shm": import zenoh.shm + + return zenoh.shm + + raise AttributeError(f"module '{__name__}' has no attribute '{name}'")