From cef7236c8012a441203c96acb1a3c01f1611e709 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Tue, 15 Oct 2013 22:52:59 +0000 Subject: [PATCH] GTTF: When faking urllib2.HTTPError use int type for HTTP error code This makes exception catching code which compares the code with numeric values work as expected. pythonis not PHP and 500 != '500'. BUG=none Review URL: https://codereview.chromium.org/27260007 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@228788 0039d316-1c4b-4281-b951-d872f2087c98 --- rietveld.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rietveld.py b/rietveld.py index aa5897e62..7e476fb6d 100644 --- a/rietveld.py +++ b/rietveld.py @@ -365,7 +365,8 @@ class Rietveld(object): m = re.search(r'(50\d) Server Error', msg) if m: # Fake an HTTPError exception. Cheezy. :( - raise urllib2.HTTPError(request_path, m.group(1), msg, None, None) + raise urllib2.HTTPError( + request_path, int(m.group(1)), msg, None, None) old_error_exit(msg) upload.ErrorExit = trap_http_500