diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index edbe29d1..fbf9f038 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1179,7 +1179,7 @@ class Client(Methods, BaseClient): try: module = import_module(module_path) - except ModuleNotFoundError: + except ImportError: log.warning('[LOAD] Ignoring non-existent module "{}"'.format(module_path)) continue @@ -1215,7 +1215,7 @@ class Client(Methods, BaseClient): try: module = import_module(module_path) - except ModuleNotFoundError: + except ImportError: log.warning('[UNLOAD] Ignoring non-existent module "{}"'.format(module_path)) continue