diff options
Diffstat (limited to 'src/Hooks/abrt_exception_handler.py.in')
-rw-r--r-- | src/Hooks/abrt_exception_handler.py.in | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index b5e15b80..8a5d8060 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -1,3 +1,4 @@ +#:mode=python: # -*- coding: utf-8 -*- ## Copyright (C) 2001-2005 Red Hat, Inc. ## Copyright (C) 2001-2005 Harald Hoyer <harald@redhat.com> @@ -26,7 +27,6 @@ import os import syslog import subprocess - def write_dump(pid, tb): executable = "Exception raised from python shell" if sys.argv[0]: @@ -132,6 +132,17 @@ def installExceptionHandler(): """ sys.excepthook = lambda etype, value, tb: handleMyException((etype, value, tb)) +# install the exception handler when the abrt_exception_handler +# module is imported +try: + installExceptionHandler() +except Exception, e: + # TODO: log errors? + # OTOH, if abrt is deinstalled uncleanly + # and this file (sitecustomize.py) exists but + # abrt_exception_handler module does not exist, we probably + # don't want to irritate admins... + pass if __name__ == '__main__': # test exception raised to show the effect |