add a try catch to avoid a dumb error

This commit is contained in:
Kay0u 2021-10-14 17:41:17 +02:00
parent 0353307716
commit 4a15903d3d
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

5
run.py
View file

@ -523,7 +523,10 @@ async def broadcast(message, channels):
dead_ws.append(ws)
for to_remove in dead_ws:
ws_list.remove(to_remove)
try:
ws_list.remove(to_remove)
except ValueError:
pass
def subscribe(ws, channel):
subscriptions[channel].append(ws)