From e823ae46c34ab1ea5e8872b5c9a2edc871216214 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 13 Nov 2009 14:51:46 +0100 Subject: disable lib/Python, we don't use it anymore (run tested) Signed-off-by: Denys Vlasenko --- src/Hooks/abrt_exception_handler.py.in | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/Hooks/abrt_exception_handler.py.in') diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index 5514f1a4..4e48c81e 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -46,8 +46,9 @@ import sys import os import syslog import subprocess -# abrt lib for saving debugdumps -import ABRTUtils +##ok to delete? +## # abrt lib for saving debugdumps +## import ABRTUtils __DUMPHASH = {} # FIXME: do length limits on obj dumps. @@ -108,7 +109,7 @@ def write_dump(pid, tb_uuid, tb): executable = "Exception raised from python shell" if sys.argv[0]: executable = os.path.abspath(sys.argv[0]) - + command = ["abrt-pyhook-helper"] command.append("--pid=%s" % pid) command.append("--executable=%s" % executable) @@ -180,12 +181,12 @@ def handleMyException((etype, value, tb)): # ignore uncaught ctrl-c if etype == KeyboardInterrupt: return sys.__excepthook__(etype, value, tb) - + try: import os.path from hashlib import md5 import traceback - + syslog.syslog("abrt: Pyhook: Detected unhandled exception in %s " % sys.argv[0]) elist = traceback.format_exception (etype, value, tb) tblast = traceback.extract_tb(tb, limit=None) @@ -199,20 +200,20 @@ def handleMyException((etype, value, tb)): ll.extend(tblast[:3]) ll[0] = os.path.basename(tblast[0]) tblast = ll - + m = md5() ntext = "" for t in tblast: ntext += str(t) + ":" m.update(str(t)) - + tb_uuid = str(m.hexdigest())[:8] text += tb_uuid + " " + ntext - + text += extxt[0] text += "\n" text += "".join(elist) - + trace = tb while trace.tb_next: trace = trace.tb_next @@ -223,7 +224,7 @@ def handleMyException((etype, value, tb)): text += "%s: %s\n" % (key, val) except: pass - + # add coredump saving write_dump(os.getpid(), tb_uuid, text) except: #silently ignore any error in this hook, to not interfere with the python scripts -- cgit