From c09ac1c94db4fc13d558a3c51cb61ff02af7960d Mon Sep 17 00:00:00 2001 From: tk <62570383+tksoftw@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:55:16 -0400 Subject: [PATCH] Fix JSONDecodeError when closing tab new chrome versions --- pychrome/tab.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pychrome/tab.py b/pychrome/tab.py index ee398bb..7a23a98 100644 --- a/pychrome/tab.py +++ b/pychrome/tab.py @@ -120,6 +120,8 @@ def _recv_loop(self): self._ws.settimeout(1) message_json = self._ws.recv() message = json.loads(message_json) + except json.decoder.JSONDecodeError: # tab closed + continue except websocket.WebSocketTimeoutException: continue except (websocket.WebSocketException, OSError):