From e3a8d198917f4246365e09fa975d55c64082cd2e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 9 Nov 2022 18:41:54 -0500 Subject: work around Python 3.11 IntEnum issue; update FastIntFlag in [1], Python 3.11 seems to have changed the behavior of IntEnum. We didn't notice this because we have our own workaround class already, but typing did. Ensure we remain compatible with IntFlag. This change also modifies FastIntFlag to no longer use global symbols; this is unnecessary as we assign FastIntFlag members explicitly. Use of ``symbol()`` should probably be phased out. [1] https://github.com/python/cpython/issues/99304 Fixes: #8783 Change-Id: I8ae2e871ff1467ae5ca1f63e66b5dae45d4a6c93 --- lib/sqlalchemy/dialects/postgresql/psycopg2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/postgresql') diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 4a8df5b5e..cb5cab178 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -583,7 +583,7 @@ class ExecutemanyMode(FastIntFlag): ( EXECUTEMANY_VALUES, EXECUTEMANY_VALUES_PLUS_BATCH, -) = tuple(ExecutemanyMode) +) = ExecutemanyMode.__members__.values() class PGDialect_psycopg2(_PGDialect_common_psycopg): -- cgit v1.2.1