@@ -618,7 +618,9 @@ async def _handler(self, ws: ClientConnection) -> None:
618
618
for task in pending :
619
619
task .cancel ()
620
620
for task in done :
621
- if isinstance (task .result (), (asyncio .TimeoutError , ConnectionClosed , TimeoutError )):
621
+ if isinstance (
622
+ task .result (), (asyncio .TimeoutError , ConnectionClosed , TimeoutError )
623
+ ):
622
624
should_reconnect = True
623
625
if should_reconnect is True :
624
626
for original_id , payload in list (self ._inflight .items ()):
@@ -692,7 +694,9 @@ async def _start_receiving(self, ws: ClientConnection) -> Exception:
692
694
except Exception as e :
693
695
if isinstance (e , ssl .SSLError ):
694
696
e = ConnectionClosed
695
- if not isinstance (e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )):
697
+ if not isinstance (
698
+ e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )
699
+ ):
696
700
logger .exception ("Websocket receiving exception" , exc_info = e )
697
701
for fut in self ._received .values ():
698
702
if not fut .done ():
@@ -717,7 +721,9 @@ async def _start_sending(self, ws) -> Exception:
717
721
except Exception as e :
718
722
if isinstance (e , ssl .SSLError ):
719
723
e = ConnectionClosed
720
- if not isinstance (e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )):
724
+ if not isinstance (
725
+ e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )
726
+ ):
721
727
logger .exception ("Websocket sending exception" , exc_info = e )
722
728
if to_send is not None :
723
729
self ._received [to_send ["id" ]].set_exception (e )
0 commit comments