diff --git a/platypush/context/__init__.py b/platypush/context/__init__.py index d5d9829fcd..874598be8a 100644 --- a/platypush/context/__init__.py +++ b/platypush/context/__init__.py @@ -61,7 +61,7 @@ def get_plugin(plugin_name, reload=False): try: plugin = importlib.import_module('platypush.plugins.' + plugin_name) - except ModuleNotFoundError as e: + except ImportError as e: logging.warning('No such plugin: {}'.format(plugin_name)) raise RuntimeError(e) diff --git a/platypush/utils/__init__.py b/platypush/utils/__init__.py index f254a453e9..6fcc2dc571 100644 --- a/platypush/utils/__init__.py +++ b/platypush/utils/__init__.py @@ -20,7 +20,7 @@ def get_message_class_by_type(msgtype): try: module = importlib.import_module('platypush.message.' + msgtype) - except ModuleNotFoundError as e: + except ImportError as e: logging.warning('Unsupported message type {}'.format(msgtype)) raise RuntimeError(e)