Skip to content

Commit 4251caf

Browse files
author
Sam McHardy
committed
Handle imports from websockets
1 parent 2868498 commit 4251caf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

binance/streams.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(
5757
self._is_binary = is_binary
5858
self._conn = None
5959
self._socket = None
60-
self.ws: Optional[ws.WebSocketClientProtocol] = None
60+
self.ws: Optional[ws.WebSocketClientProtocol] = None # type: ignore
6161
self.ws_state = WSListenerState.INITIALISING
6262
self._queue = asyncio.Queue()
6363
self._handle_read_loop = None
@@ -84,7 +84,7 @@ async def connect(self):
8484
assert self._path
8585
self.ws_state = WSListenerState.STREAMING
8686
ws_url = self._url + self._prefix + self._path
87-
self._conn = ws.connect(ws_url, close_timeout=0.1)
87+
self._conn = ws.connect(ws_url, close_timeout=0.1) # type: ignore
8888
try:
8989
self.ws = await self._conn.__aenter__()
9090
except: # noqa
@@ -131,10 +131,10 @@ async def _read_loop(self):
131131
break
132132
elif self.ws_state == WSListenerState.EXITING:
133133
break
134-
elif self.ws.state == ws.protocol.State.CLOSING:
134+
elif self.ws.state == ws.protocol.State.CLOSING: # type: ignore
135135
await asyncio.sleep(0.1)
136136
continue
137-
elif self.ws.state == ws.protocol.State.CLOSED:
137+
elif self.ws.state == ws.protocol.State.CLOSED: # type: ignore
138138
await self._reconnect()
139139
elif self.ws_state == WSListenerState.STREAMING:
140140
res = await asyncio.wait_for(self.ws.recv(), timeout=self.TIMEOUT)

0 commit comments

Comments
 (0)