Skip to content

Commit

Permalink
stlye: fix E721
Browse files Browse the repository at this point in the history
  • Loading branch information
knrdl committed Jul 31, 2023
1 parent adadd31 commit 7be3603
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 7be3603

Please sign in to comment.