Fix verify invalid json
This commit is contained in:
parent
60146a083c
commit
796ee572ce
1 changed files with 7 additions and 4 deletions
|
@ -936,10 +936,13 @@ class ContentManager(object):
|
||||||
if type(file) is dict:
|
if type(file) is dict:
|
||||||
new_content = file
|
new_content = file
|
||||||
else:
|
else:
|
||||||
if sys.version_info.major == 3 and sys.version_info.minor < 6:
|
try:
|
||||||
new_content = json.loads(file.read().decode("utf8"))
|
if sys.version_info.major == 3 and sys.version_info.minor < 6:
|
||||||
else:
|
new_content = json.loads(file.read().decode("utf8"))
|
||||||
new_content = json.load(file)
|
else:
|
||||||
|
new_content = json.load(file)
|
||||||
|
except Exception as err:
|
||||||
|
raise VerifyError("Invalid json file: %s" % err)
|
||||||
if inner_path in self.contents:
|
if inner_path in self.contents:
|
||||||
old_content = self.contents.get(inner_path, {"modified": 0})
|
old_content = self.contents.get(inner_path, {"modified": 0})
|
||||||
# Checks if its newer the ours
|
# Checks if its newer the ours
|
||||||
|
|
Loading…
Reference in a new issue