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:
|
||||
new_content = file
|
||||
else:
|
||||
try:
|
||||
if sys.version_info.major == 3 and sys.version_info.minor < 6:
|
||||
new_content = json.loads(file.read().decode("utf8"))
|
||||
else:
|
||||
new_content = json.load(file)
|
||||
except Exception as err:
|
||||
raise VerifyError("Invalid json file: %s" % err)
|
||||
if inner_path in self.contents:
|
||||
old_content = self.contents.get(inner_path, {"modified": 0})
|
||||
# Checks if its newer the ours
|
||||
|
|
Loading…
Reference in a new issue