From: Mike Bayer Date: Wed, 2 Dec 2020 01:55:06 +0000 (-0500) Subject: Make sure asyncpgfallback has __slots__ X-Git-Tag: rel_1_4_0b2~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=869bd9cee0a1e6cde0699fb6184a35c50f74e138;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Make sure asyncpgfallback has __slots__ the test suite failed to find that we started accessing a non-existent slot "_isolation_setting" added by me in 9b779611f9, as the test suite makes use of the AsyncAdaptFallback_asyncpg_connection subclass, which didn't include __slots__ and therefore didn't catch that _isolation_setting wasn't added to slots. Fixes: #5739 Change-Id: Ibbbedc2ee0f1d1c9d91ba7898d755812deccb380 --- diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py index 412feda0fd..889293eabd 100644 --- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py +++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py @@ -480,6 +480,7 @@ class AsyncAdapt_asyncpg_connection: "dbapi", "_connection", "isolation_level", + "_isolation_setting", "readonly", "deferrable", "_transaction", @@ -573,6 +574,8 @@ class AsyncAdapt_asyncpg_connection: class AsyncAdaptFallback_asyncpg_connection(AsyncAdapt_asyncpg_connection): + __slots__ = () + await_ = staticmethod(await_fallback)