[diffoscope] 02/05: comparators.json: Catch bad JSON errors on Python pre-3.5. (Closes: #855233)
Mattia Rizzolo
mattia at debian.org
Mon Feb 20 19:53:13 CET 2017
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to annotated tag 77_bpo8+1
in repository diffoscope.
commit 2493135b99cd896f2df8e93ddbdc21f0d903b351
Author: Brett Smith <brettcsmith at brettcsmith.org>
Date: Wed Feb 15 14:39:41 2017 -0500
comparators.json: Catch bad JSON errors on Python pre-3.5. (Closes: #855233)
json.JSONDecodeError was introduced in Python 3.5. Earlier versions raised
ValueError, which is the base class of JSONDecodeError. Catch that instead.
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
diffoscope/comparators/json.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffoscope/comparators/json.py b/diffoscope/comparators/json.py
index d46c830..943ec64 100644
--- a/diffoscope/comparators/json.py
+++ b/diffoscope/comparators/json.py
@@ -37,7 +37,7 @@ class JSONFile(File):
with open(file.path) as f:
try:
file.parsed = json.load(f, object_pairs_hook=collections.OrderedDict)
- except json.JSONDecodeError:
+ except ValueError:
return False
return True
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list