]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Make sure asyncpgfallback has __slots__
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 2 Dec 2020 01:55:06 +0000 (20:55 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 2 Dec 2020 01:55:06 +0000 (20:55 -0500)
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

lib/sqlalchemy/dialects/postgresql/asyncpg.py

index 412feda0fda2f21af044492762219f595d0ae397..889293eabda26bcf69a440e68a583b041d68215e 100644 (file)
@@ -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)