summaryrefslogtreecommitdiffstats
path: root/src/Hooks/abrt_exception_handler.py.in
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-13 14:51:46 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-13 14:51:46 +0100
commite823ae46c34ab1ea5e8872b5c9a2edc871216214 (patch)
treee7a517057c70d7a433874c8e4c3a95c6a20b2947 /src/Hooks/abrt_exception_handler.py.in
parent0e0aa3788dc3f2bf91f566fee6b695d0cd9939f4 (diff)
downloadabrt-e823ae46c34ab1ea5e8872b5c9a2edc871216214.tar.gz
abrt-e823ae46c34ab1ea5e8872b5c9a2edc871216214.tar.xz
abrt-e823ae46c34ab1ea5e8872b5c9a2edc871216214.zip
disable lib/Python, we don't use it anymore (run tested)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Hooks/abrt_exception_handler.py.in')
-rw-r--r--src/Hooks/abrt_exception_handler.py.in21
1 files changed, 11 insertions, 10 deletions
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