@@ -618,7 +618,9 @@ async def _handler(self, ws: ClientConnection) -> None:
618618 for task in pending :
619619 task .cancel ()
620620 for task in done :
621- if isinstance (task .result (), (asyncio .TimeoutError , ConnectionClosed , TimeoutError )):
621+ if isinstance (
622+ task .result (), (asyncio .TimeoutError , ConnectionClosed , TimeoutError )
623+ ):
622624 should_reconnect = True
623625 if should_reconnect is True :
624626 for original_id , payload in list (self ._inflight .items ()):
@@ -692,7 +694,9 @@ async def _start_receiving(self, ws: ClientConnection) -> Exception:
692694 except Exception as e :
693695 if isinstance (e , ssl .SSLError ):
694696 e = ConnectionClosed
695- if not isinstance (e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )):
697+ if not isinstance (
698+ e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )
699+ ):
696700 logger .exception ("Websocket receiving exception" , exc_info = e )
697701 for fut in self ._received .values ():
698702 if not fut .done ():
@@ -717,7 +721,9 @@ async def _start_sending(self, ws) -> Exception:
717721 except Exception as e :
718722 if isinstance (e , ssl .SSLError ):
719723 e = ConnectionClosed
720- if not isinstance (e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )):
724+ if not isinstance (
725+ e , (asyncio .TimeoutError , TimeoutError , ConnectionClosed )
726+ ):
721727 logger .exception ("Websocket sending exception" , exc_info = e )
722728 if to_send is not None :
723729 self ._received [to_send ["id" ]].set_exception (e )
0 commit comments