diff --git a/redis/asyncio/client.py b/redis/asyncio/client.py index 381df50ccc..e4d2e776bc 100644 --- a/redis/asyncio/client.py +++ b/redis/asyncio/client.py @@ -783,7 +783,7 @@ async def __aexit__(self, exc_type, exc_value, traceback): def __del__(self): if self.connection: - self.connection.clear_connect_callbacks() + self.connection._deregister_connect_callback(self.on_connect) async def aclose(self): # In case a connection property does not yet exist