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

Unified Diff: breakpad.py

Issue 2109001: Fix KeyboardInterrupt exception filtering. (Closed)
Patch Set: Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: breakpad.py
diff --git a/breakpad.py b/breakpad.py
index 2d662d7e700ddda7827aa0c5c550c340733f7375..356774d89bc9ee574edfb2fe4908adbc888093b7 100644
--- a/breakpad.py
+++ b/breakpad.py
@@ -13,14 +13,19 @@ import traceback
import socket
import sys
+# Configure these values.
+DEFAULT_URL = 'http://chromium-status.appspot.com/breakpad'
-def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'):
+def SendStack(last_tb, stack, url=None):
+ if not url:
+ url = DEFAULT_URL
print 'Sending crash report ...'
try:
params = {
'args': sys.argv,
'stack': stack,
'user': getpass.getuser(),
+ 'exception': last_tb,
}
request = urllib.urlopen(url, urllib.urlencode(params))
print request.read()
@@ -30,9 +35,11 @@ def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'):
def CheckForException():
- last_tb = getattr(sys, 'last_traceback', None)
- if last_tb and sys.last_type is not KeyboardInterrupt:
- SendStack(''.join(traceback.format_tb(last_tb)))
+ last_value = getattr(sys, 'last_value', None)
+ if last_value and not isinstance(last_value, KeyboardInterrupt):
+ last_tb = getattr(sys, 'last_traceback', None)
+ if last_tb:
+ SendStack(repr(last_value), ''.join(traceback.format_tb(last_tb)))
if (not 'test' in sys.modules['__main__'].__file__ and
« 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