From e2c846205b74ec73b0a21df8481336fa8e501f25 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 22 Sep 2022 21:42:58 -0400 Subject: [PATCH] self.clients was already a set. cannot subscript --- app/classes/web/websocket_helper.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/classes/web/websocket_helper.py b/app/classes/web/websocket_helper.py index ea8b07e5..f7b26189 100644 --- a/app/classes/web/websocket_helper.py +++ b/app/classes/web/websocket_helper.py @@ -27,7 +27,7 @@ class WebSocketHelper: f"Sending to {len(self.clients)} clients: " f"{json.dumps({'event': event_type, 'data': data})}" ) - for client in self.clients[:]: # pylint: disable=unsubscriptable-object + for client in self.clients: try: self.send_message(client, event_type, data) except Exception as e: @@ -36,9 +36,6 @@ class WebSocketHelper: f"{client.get_remote_ip()} {e}" ) - # Excempting 'unsubscriptable-object' warning as false positive from 'self' use - # Code has been tested by Andrew and functions as intended. - def broadcast_page(self, page: str, event_type: str, data): def filter_fn(client): return client.page == page