From ea16f92199e2f11b03cb1783c1ad99d5ad3aabd4 Mon Sep 17 00:00:00 2001 From: carlosmiei <43336371+carlosmiei@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:07:54 +0000 Subject: [PATCH] fix(__aexit__): replace fail_connection with close --- binance/streams.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binance/streams.py b/binance/streams.py index 404b4fa48..f71d5236c 100755 --- a/binance/streams.py +++ b/binance/streams.py @@ -79,7 +79,8 @@ async def __aexit__(self, exc_type, exc_val, exc_tb): await self._exit_coro(self._path) self.ws_state = WSListenerState.EXITING if self.ws: - self.ws.fail_connection() + # self.ws.fail_connection() + await self.ws.close() if self._conn and hasattr(self._conn, "protocol"): await self._conn.__aexit__(exc_type, exc_val, exc_tb) self.ws = None