[diffoscope] 01/01: JSONReaderV1: fail if version != 1
Ximin Luo
infinity0 at debian.org
Mon May 29 22:07:21 CEST 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch experimental
in repository diffoscope.
commit 9edbd00732b85e635eda48f0df1ddf2158195508
Author: Ximin Luo <infinity0 at debian.org>
Date: Mon May 29 22:06:58 2017 +0200
JSONReaderV1: fail if version != 1
---
diffoscope/readers/json.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffoscope/readers/json.py b/diffoscope/readers/json.py
index 0891e52..7a24303 100644
--- a/diffoscope/readers/json.py
+++ b/diffoscope/readers/json.py
@@ -30,7 +30,7 @@ class JSONReaderV1(object):
def load(self, fp, fn):
raw = json.load(codecs.getreader("utf-8")(fp))
- if JSON_FORMAT_MAGIC not in raw:
+ if JSON_FORMAT_MAGIC not in raw or raw[JSON_FORMAT_MAGIC] != 1:
raise UnrecognizedFormatError("magic not found in json: %s" % JSON_FORMAT_MAGIC)
return self.load_rec(raw)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list