Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: trychange.py

Issue 274031: Check Exception object's argument length in trychange.py. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Client-side script to send a try job to the try server. It communicates to 5 """Client-side script to send a try job to the try server. It communicates to
6 the try server by either writting to a svn repository or by directly connecting 6 the try server by either writting to a svn repository or by directly connecting
7 to the server by HTTP. 7 to the server by HTTP.
8 """ 8 """
9 9
10 10
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 proxies = None 311 proxies = None
312 if options.proxy: 312 if options.proxy:
313 if options.proxy.lower() == 'none': 313 if options.proxy.lower() == 'none':
314 # Effectively disable HTTP_PROXY or Internet settings proxy setup. 314 # Effectively disable HTTP_PROXY or Internet settings proxy setup.
315 proxies = {} 315 proxies = {}
316 else: 316 else:
317 proxies = {'http': options.proxy, 'https': options.proxy} 317 proxies = {'http': options.proxy, 'https': options.proxy}
318 try: 318 try:
319 connection = urllib.urlopen(url, urllib.urlencode(values), proxies=proxies) 319 connection = urllib.urlopen(url, urllib.urlencode(values), proxies=proxies)
320 except IOError, e: 320 except IOError, e:
321 # TODO(thestig) this probably isn't quite right. 321 if (values.get('bot') and len(e.args) > 2 and
322 if values.get('bot') and e[2] == 'got a bad status line': 322 e.args[2] == 'got a bad status line'):
323 raise NoTryServerAccess('%s is unaccessible. Bad --bot argument?' % url) 323 raise NoTryServerAccess('%s is unaccessible. Bad --bot argument?' % url)
324 else: 324 else:
325 raise NoTryServerAccess('%s is unaccessible.' % url) 325 raise NoTryServerAccess('%s is unaccessible. Reason: %s' % (url,
326 str(e.args)))
326 if not connection: 327 if not connection:
327 raise NoTryServerAccess('%s is unaccessible.' % url) 328 raise NoTryServerAccess('%s is unaccessible.' % url)
328 if connection.read() != 'OK': 329 if connection.read() != 'OK':
329 raise NoTryServerAccess('%s is unaccessible.' % url) 330 raise NoTryServerAccess('%s is unaccessible.' % url)
330 return options.name 331 return options.name
331 332
332 333
333 def _SendChangeSVN(options): 334 def _SendChangeSVN(options):
334 """Send a change to the try server by committing a diff file on a subversion 335 """Send a change to the try server by committing a diff file on a subversion
335 server.""" 336 server."""
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if patch_name == 'Unnamed': 586 if patch_name == 'Unnamed':
586 print "Note: use --name NAME to change the try's name." 587 print "Note: use --name NAME to change the try's name."
587 except (InvalidScript, NoTryServerAccess), e: 588 except (InvalidScript, NoTryServerAccess), e:
588 if swallow_exception: 589 if swallow_exception:
589 return 590 return
590 print e 591 print e
591 592
592 593
593 if __name__ == "__main__": 594 if __name__ == "__main__":
594 TryChange(None, None, False) 595 TryChange(None, None, False)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698