From d8a0b4a25f0e8832a255152c7dd777d8082e4517 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 7 Aug 2015 20:44:47 +0300 Subject: Handle missing reference field --- obbench | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'obbench') diff --git a/obbench b/obbench index 97fd071..157c1f5 100755 --- a/obbench +++ b/obbench @@ -249,7 +249,7 @@ class ObnamBenchmarker(cliapp.Application): '({ref})\n'.format( link=self.q(basename), duration=self.q('%.1f' % step['duration']), - ref=step['reference'])) + ref=step.get('reference', 0))) f.write('\n') f.write('\n') @@ -338,7 +338,7 @@ class ObnamBenchmarker(cliapp.Application): return (obj['date'], obj['commit_id']) def total(obj, field): - return sum(step[field] for step in obj['steps']) + return sum(step.get(field, 0) for step in obj['steps']) sorted_objs = [] for obj in objs: -- cgit v1.2.1