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
experimental/szager/collated-output
thestig@chromium.org 16 years ago
parent 88c32d80de
commit cce9e1c2fa

@ -318,11 +318,12 @@ def _SendChangeHTTP(options):
try: try:
connection = urllib.urlopen(url, urllib.urlencode(values), proxies=proxies) connection = urllib.urlopen(url, urllib.urlencode(values), proxies=proxies)
except IOError, e: except IOError, e:
# TODO(thestig) this probably isn't quite right. if (values.get('bot') and len(e.args) > 2 and
if values.get('bot') and e[2] == 'got a bad status line': e.args[2] == 'got a bad status line'):
raise NoTryServerAccess('%s is unaccessible. Bad --bot argument?' % url) raise NoTryServerAccess('%s is unaccessible. Bad --bot argument?' % url)
else: else:
raise NoTryServerAccess('%s is unaccessible.' % url) raise NoTryServerAccess('%s is unaccessible. Reason: %s' % (url,
str(e.args)))
if not connection: if not connection:
raise NoTryServerAccess('%s is unaccessible.' % url) raise NoTryServerAccess('%s is unaccessible.' % url)
if connection.read() != 'OK': if connection.read() != 'OK':

Loading…
Cancel
Save