From: Mike Bayer Date: Wed, 31 Mar 2021 13:58:19 +0000 (-0400) Subject: dont import typing on Python 3.4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c18de6817b2ee91fa0205d9c033c4e36e0ad7da;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git dont import typing on Python 3.4 Repaired an import for "typing" that is not supported in Python 3.4, which is the bottom version supported by SQLAlchemy 1.3. Fixes: #6168 Change-Id: I282c04be0dd40e2b6d5dc3c7f7dad65746d60008 --- diff --git a/doc/build/changelog/unreleased_13/6168.rst b/doc/build/changelog/unreleased_13/6168.rst new file mode 100644 index 0000000000..cf70b92fa5 --- /dev/null +++ b/doc/build/changelog/unreleased_13/6168.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: bug, general + :tickets: 6168 + + Repaired an import for "typing" that is not supported in Python 3.4, which + is the bottom version supported by SQLAlchemy 1.3. diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index a1d55376dd..2ca060b2a5 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -186,7 +186,10 @@ if py3k: # as the __traceback__ object creates a cycle del exception, replace_context, from_, with_traceback - from typing import TYPE_CHECKING + if py35: + from typing import TYPE_CHECKING + else: + TYPE_CHECKING = False def u(s): return s