mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Don't miserably crash because of syntax error in apps.json
This commit is contained in:
parent
6fb6cdc15d
commit
59285decfc
1 changed files with 6 additions and 1 deletions
|
@ -1256,7 +1256,12 @@ class AppCatalog(TestSuite):
|
||||||
# Fetch apps.json content at this date
|
# Fetch apps.json content at this date
|
||||||
commit = git(["rev-list", "-1", "--before='%s'" % t.strftime("%b %d %Y"), "master"])
|
commit = git(["rev-list", "-1", "--before='%s'" % t.strftime("%b %d %Y"), "master"])
|
||||||
raw_json_at_this_date = git(["show", "%s:apps.json" % commit])
|
raw_json_at_this_date = git(["show", "%s:apps.json" % commit])
|
||||||
|
try:
|
||||||
json_at_this_date = json.loads(raw_json_at_this_date)
|
json_at_this_date = json.loads(raw_json_at_this_date)
|
||||||
|
# This can happen in stupid cases where there was a temporary syntax error in the json..
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
print("Failed to parse apps.json history for at commit %s / %s ... ignoring " % (commit, t))
|
||||||
|
continue
|
||||||
|
|
||||||
yield (t, json_at_this_date.get(self.app_id))
|
yield (t, json_at_this_date.get(self.app_id))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue