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

Side by Side Diff: breakpad.py

Issue 553139: gclient: Keyboard interrupt should not cause request to send stack (Closed)
Patch Set: Created 10 years, 11 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
« 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 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Breakpad for Python. 5 """Breakpad for Python.
6 6
7 Sends a notification when a process stops on an exception.""" 7 Sends a notification when a process stops on an exception."""
8 8
9 import atexit 9 import atexit
10 import getpass 10 import getpass
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 request = urllib.urlopen(url, urllib.urlencode(params)) 28 request = urllib.urlopen(url, urllib.urlencode(params))
29 print request.read() 29 print request.read()
30 request.close() 30 request.close()
31 except IOError: 31 except IOError:
32 print('There was a failure while trying to send the stack trace. Too bad.') 32 print('There was a failure while trying to send the stack trace. Too bad.')
33 33
34 34
35 def CheckForException(): 35 def CheckForException():
36 last_tb = getattr(sys, 'last_traceback', None) 36 last_tb = getattr(sys, 'last_traceback', None)
37 if last_tb: 37 if last_tb and sys.last_type is not KeyboardInterrupt:
38 SendStack(''.join(traceback.format_tb(last_tb))) 38 SendStack(''.join(traceback.format_tb(last_tb)))
39 39
40 40
41 if (not 'test' in sys.modules['__main__'].__file__ and 41 if (not 'test' in sys.modules['__main__'].__file__ and
42 socket.gethostname().endswith('.google.com')): 42 socket.gethostname().endswith('.google.com')):
43 # Skip unit tests and we don't want anything from non-googler. 43 # Skip unit tests and we don't want anything from non-googler.
44 atexit.register(CheckForException) 44 atexit.register(CheckForException)
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