From 7be36031f4c4597659109667fe66d33e8c41f952 Mon Sep 17 00:00:00 2001 From: knrdl <35548889+knrdl@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:33:39 +0200 Subject: [PATCH] stlye: fix E721 --- server/ws.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/ws.py b/server/ws.py index 9deb062..d1a5a01 100644 --- a/server/ws.py +++ b/server/ws.py @@ -73,7 +73,7 @@ async def after_connect(self, websocket: WebSocket): for handler in _ws_on_connect_handler: try: result = await handler(websocket.state) - if type(result) == tuple and len(result) == 2: + if isinstance(result, tuple) and len(result) == 2: action, response = result await send_json(websocket, action, response) elif result is not None: @@ -89,8 +89,8 @@ async def on_receive(self, websocket: WebSocket, data: str): try: response = await _ws_actions[action](websocket.state, **payload) if response is not None: - if type(response) == tuple and len(response) == 2 and type(response[0]) == dict and type( - response[1]) == bytes: + if isinstance(response, tuple) and len(response) == 2 and \ + isinstance(response[0], dict) and isinstance(response[1], bytes): payload, binary = response await send_json_bytes(websocket, action, payload, binary) else: