Commit cce9e1c2 authored by thestig@chromium.org's avatar thestig@chromium.org

Check Exception object's argument length in trychange.py.

Review URL: http://codereview.chromium.org/274031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28931 0039d316-1c4b-4281-b951-d872f2087c98
parent 88c32d80
......@@ -318,11 +318,12 @@ def _SendChangeHTTP(options):
try:
connection = urllib.urlopen(url, urllib.urlencode(values), proxies=proxies)
except IOError, e:
# TODO(thestig) this probably isn't quite right.
if values.get('bot') and e[2] == 'got a bad status line':
if (values.get('bot') and len(e.args) > 2 and
e.args[2] == 'got a bad status line'):
raise NoTryServerAccess('%s is unaccessible. Bad --bot argument?' % url)
else:
raise NoTryServerAccess('%s is unaccessible.' % url)
raise NoTryServerAccess('%s is unaccessible. Reason: %s' % (url,
str(e.args)))
if not connection:
raise NoTryServerAccess('%s is unaccessible.' % url)
if connection.read() != 'OK':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment