diff --git a/zulip_bots/zulip_bots/finder.py b/zulip_bots/zulip_bots/finder.py index ff7063e..0c44b1b 100644 --- a/zulip_bots/zulip_bots/finder.py +++ b/zulip_bots/zulip_bots/finder.py @@ -27,7 +27,9 @@ def import_module_by_name(name: Text) -> Any: import importlib try: return importlib.import_module(name) - except ModuleNotFoundError: + except ImportError: + return None + except ModuleNotFoundError: # Specific exception supported >=Python3.6 return None def resolve_bot_path(name: Text) -> Optional[Tuple[Text, Text]]: