diff options
author | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 11:41:16 +0000 |
---|---|---|
committer | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 11:41:16 +0000 |
commit | f80f4ad38f48e88ed8f4bf44a185e76eb4e8fc3f (patch) | |
tree | 348440799dc5d64a7e412d8e11850b3094c48170 | |
parent | 965b13238fb7a4d716a6f8946117ddb2672da33d (diff) | |
download | chromium_src-f80f4ad38f48e88ed8f4bf44a185e76eb4e8fc3f.zip chromium_src-f80f4ad38f48e88ed8f4bf44a185e76eb4e8fc3f.tar.gz chromium_src-f80f4ad38f48e88ed8f4bf44a185e76eb4e8fc3f.tar.bz2 |
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
-rw-r--r-- | PRESUBMIT.py | 6 |
1 files changed, 5 insertions, 1 deletions
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: |