diff options
author | Everett Hildenbrandt <hildenb2@illinois.edu> | 2018-06-01 13:57:22 +0800 |
---|---|---|
committer | Everett Hildenbrandt <hildenb2@illinois.edu> | 2018-06-02 03:18:42 +0800 |
commit | 177e709513e02f446a105792f1515d1952cb9fc6 (patch) | |
tree | 0d75df294941e461e110e23b8b2e1199364824f0 | |
parent | fea1020f4591dffcf043e99b7bf9326e0fb53dcb (diff) | |
download | dexon-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-x | test.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)): |