From d73531a722dc852a599af9899fdc7870248eb6c1 Mon Sep 17 00:00:00 2001 From: "epoger@google.com" Date: Wed, 4 Sep 2013 16:27:16 +0000 Subject: svndiff.py: properly handle empty expectations dictionary BUG=skia:1588 R=jvanverth@google.com Review URL: https://codereview.chromium.org/23769005 git-svn-id: http://skia.googlecode.com/svn/trunk@11078 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tools/jsondiff.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/jsondiff.py') diff --git a/tools/jsondiff.py b/tools/jsondiff.py index 76958c6428..050a177b00 100755 --- a/tools/jsondiff.py +++ b/tools/jsondiff.py @@ -80,6 +80,12 @@ class GMDiffer(object): result_dict = {} json_dict = gm_json.LoadFromString(contents) all_expectations = json_dict[gm_json.JSONKEY_EXPECTEDRESULTS] + + # Prevent https://code.google.com/p/skia/issues/detail?id=1588 + # ('svndiff.py: 'NoneType' object has no attribute 'keys'') + if not all_expectations: + return result_dict + for test_name in all_expectations.keys(): test_expectations = all_expectations[test_name] allowed_digests = test_expectations[ -- cgit v1.2.3