use more generic ImportError to check for module

ModuleNotFoundError was only introduced in Python 3.6.
This commit is contained in:
Sarah Hoffmann
2021-04-23 21:10:19 +02:00
parent 9685c68e30
commit 3a642d50a4
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ from psycopg2.extras import wait_select
try:
import psycopg2.errors # pylint: disable=no-name-in-module,import-error
__has_psycopg2_errors__ = True
except ModuleNotFoundError:
except ImportError:
__has_psycopg2_errors__ = False
LOG = logging.getLogger()