From 64775f52092d306ece84c19eaf322fd84a98e72c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 4 Mar 2019 12:50:42 +0100 Subject: [PATCH] Fix "ModuleNotFoundError is not defined" error for Python <3.6 --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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