From 995b451d11de417abf854690ed322e032e79d745 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 1 Mar 2018 01:42:59 +0100 Subject: [PATCH] Detect broken JSON and download new. --- tcllib/devlist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcllib/devlist.py b/tcllib/devlist.py index d1dc0d1..fe80ce0 100644 --- a/tcllib/devlist.py +++ b/tcllib/devlist.py @@ -29,7 +29,7 @@ def _load_local_devicelist(): need_download = False with open(DEVICELIST_FILE, "rt") as dlfile: return json.load(dlfile), need_download - except FileNotFoundError: + except (FileNotFoundError, json.decoder.JSONDecodeError): return None, True def _download_devicelist(doit: bool):