From 174bfd213e894c0fc5bcc8685b98be2b1ddddd98 Mon Sep 17 00:00:00 2001 From: Pasha Shkaran Date: Sun, 25 Feb 2024 16:11:18 -0500 Subject: [PATCH] fix ws connection --- binance/threaded_stream.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/binance/threaded_stream.py b/binance/threaded_stream.py index 01a856ded..c4ba83333 100755 --- a/binance/threaded_stream.py +++ b/binance/threaded_stream.py @@ -3,21 +3,20 @@ from typing import Optional, Dict, Any from .client import AsyncClient -from .helpers import get_loop class ThreadedApiManager(threading.Thread): def __init__( - self, api_key: Optional[str] = None, api_secret: Optional[str] = None, - requests_params: Optional[Dict[str, Any]] = None, tld: str = 'com', - testnet: bool = False, session_params: Optional[Dict[str, Any]] = None + self, api_key: Optional[str] = None, api_secret: Optional[str] = None, + requests_params: Optional[Dict[str, Any]] = None, tld: str = 'com', + testnet: bool = False, session_params: Optional[Dict[str, Any]] = None ): """Initialise the BinanceSocketManager """ super().__init__() - self._loop: asyncio.AbstractEventLoop = get_loop() + self._loop: asyncio.AbstractEventLoop = asyncio.new_event_loop() self._client: Optional[AsyncClient] = None self._running: bool = True self._socket_running: Dict[str, bool] = {}