Remove unnecessary except ImportError for Python datetime types

The Python datetime module is available on all supported platforms. The
types are always available and never raise an ImportError.
This commit is contained in:
Jon Dufresne 2019-03-13 18:21:16 -07:00 committed by Daniele Varrazzo
parent ad4c6a4673
commit 8685120485

View File

@ -49,13 +49,10 @@ try:
except ImportError:
pass
try:
from psycopg2._psycopg import ( # noqa
PYDATE, PYDATETIME, PYDATETIMETZ, PYINTERVAL, PYTIME, PYDATEARRAY,
PYDATETIMEARRAY, PYDATETIMETZARRAY, PYINTERVALARRAY, PYTIMEARRAY,
DateFromPy, TimeFromPy, TimestampFromPy, IntervalFromPy, )
except ImportError:
pass
from psycopg2._psycopg import ( # noqa
PYDATE, PYDATETIME, PYDATETIMETZ, PYINTERVAL, PYTIME, PYDATEARRAY,
PYDATETIMEARRAY, PYDATETIMETZARRAY, PYINTERVALARRAY, PYTIMEARRAY,
DateFromPy, TimeFromPy, TimestampFromPy, IntervalFromPy, )
from psycopg2._psycopg import ( # noqa
adapt, adapters, encodings, connection, cursor,