summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/asyncio/base.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-08-27 21:50:01 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2021-08-30 14:19:36 -0400
commit1798c3cf1c407ba2a05855e97ae39997f213084d (patch)
treed6a171e80b6b988f089c574320ec7a916245ad2c /lib/sqlalchemy/ext/asyncio/base.py
parent9131a5208f28ea3c2991c2b05873a495c1a9c851 (diff)
downloadsqlalchemy-1798c3cf1c407ba2a05855e97ae39997f213084d.tar.gz
Improve error message when inspecting async proxies
Provide better error message when trying to insepct and async engine or asnyc connection. Change-Id: I907f3a22c6b76fe43df9d40cb0e69c57f74a7982
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/base.py')
-rw-r--r--lib/sqlalchemy/ext/asyncio/base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/base.py b/lib/sqlalchemy/ext/asyncio/base.py
index 3f2c084f4..3f77f5500 100644
--- a/lib/sqlalchemy/ext/asyncio/base.py
+++ b/lib/sqlalchemy/ext/asyncio/base.py
@@ -8,6 +8,7 @@ from . import exc as async_exc
class ReversibleProxy:
# weakref.ref(async proxy object) -> weakref.ref(sync proxied object)
_proxy_objects = {}
+ __slots__ = ("__weakref__",)
def _assign_proxied(self, target):
if target is not None:
@@ -46,6 +47,8 @@ class ReversibleProxy:
class StartableContext(abc.ABC):
+ __slots__ = ()
+
@abc.abstractmethod
async def start(self, is_ctxmanager=False):
pass
@@ -68,6 +71,8 @@ class StartableContext(abc.ABC):
class ProxyComparable(ReversibleProxy):
+ __slots__ = ()
+
def __hash__(self):
return id(self)