From f80f4ad38f48e88ed8f4bf44a185e76eb4e8fc3f Mon Sep 17 00:00:00 2001 From: "glider@chromium.org" Date: Thu, 18 Mar 2010 11:41:16 +0000 Subject: Fix PRESUBMIT.py to handle 'true' and 'false' literals from the JSON data. Review URL: http://codereview.chromium.org/1111001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41944 0039d316-1c4b-4281-b951-d872f2087c98 --- PRESUBMIT.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'PRESUBMIT.py') diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 57b09fb..a1010aa 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -178,8 +178,12 @@ def CheckPendingBuilds(input_api, output_api, url, max_pendings, ignored): import simplejson data = simplejson.loads(raw_data) except ImportError: + # TODO(maruel): use json parser. # simplejson is much safer. But we should be just fine enough with that: - data = eval(raw_data.replace('null', 'None')) + patched_data = raw_data.replace('null', 'None') + patched_data = patched_data.replace('false', 'False') + patched_data = patched_data.replace('true', 'True') + data = eval(patched_data) out = [] for (builder_name, builder) in data.iteritems(): if builder_name in ignored: -- cgit v1.1