aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEverett Hildenbrandt <hildenb2@illinois.edu>2018-06-01 13:57:22 +0800
committerEverett Hildenbrandt <hildenb2@illinois.edu>2018-06-02 03:18:42 +0800
commit177e709513e02f446a105792f1515d1952cb9fc6 (patch)
tree0d75df294941e461e110e23b8b2e1199364824f0
parentfea1020f4591dffcf043e99b7bf9326e0fb53dcb (diff)
downloaddexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.tar
dexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.tar.gz
dexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.tar.bz2
dexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.tar.lz
dexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.tar.xz
dexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.tar.zst
dexon-tests-177e709513e02f446a105792f1515d1952cb9fc6.zip
test.py: recover better if cannot read json
-rwxr-xr-xtest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test.py b/test.py
index e7957989d..9724a4ab3 100755
--- a/test.py
+++ b/test.py
@@ -58,7 +58,11 @@ def readJSONFile(fname):
_die("Not a file:", fname)
with open(fname, "r") as f:
fcontents = f.read()
- return json.loads(fcontents)
+ try:
+ fjson = json.loads(fcontents)
+ return fjson
+ except:
+ _logerror("Could not load json:", fname)
def writeJSONFile(fname, fcontents):
if not os.path.exists(os.path.dirname(fname)):