| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 def CheckForException(): | 37 def CheckForException(): |
| 38 last_value = getattr(sys, 'last_value', None) | 38 last_value = getattr(sys, 'last_value', None) |
| 39 if last_value and not isinstance(last_value, KeyboardInterrupt): | 39 if last_value and not isinstance(last_value, KeyboardInterrupt): |
| 40 last_tb = getattr(sys, 'last_traceback', None) | 40 last_tb = getattr(sys, 'last_traceback', None) |
| 41 if last_tb: | 41 if last_tb: |
| 42 SendStack(repr(last_value), ''.join(traceback.format_tb(last_tb))) | 42 SendStack(repr(last_value), ''.join(traceback.format_tb(last_tb))) |
| 43 | 43 |
| 44 | 44 |
| 45 if (not 'test' in sys.modules['__main__'].__file__ and | 45 if (not 'test' in sys.modules['__main__'].__file__ and |
| 46 socket.gethostname().endswith('.google.com')): | 46 socket.getfqdn().endswith('.google.com')): |
| 47 # Skip unit tests and we don't want anything from non-googler. | 47 # Skip unit tests and we don't want anything from non-googler. |
| 48 atexit.register(CheckForException) | 48 atexit.register(CheckForException) |
| OLD | NEW |