summaryrefslogtreecommitdiffstats
path: root/src/Hooks/abrt_exception_handler.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hooks/abrt_exception_handler.py.in')
-rw-r--r--src/Hooks/abrt_exception_handler.py.in26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in
index e4c97a94..8a5d8060 100644
--- a/src/Hooks/abrt_exception_handler.py.in
+++ b/src/Hooks/abrt_exception_handler.py.in
@@ -19,14 +19,13 @@
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
-Module for a ABRT exception handling hook
+Module for a userfriendly exception handling
"""
import sys
import os
import syslog
import subprocess
-import socket
def write_dump(pid, tb):
executable = "Exception raised from python shell"
@@ -36,21 +35,14 @@ def write_dump(pid, tb):
# during execution?
executable = os.path.abspath(sys.argv[0])
- # Open ABRT daemon's socket and write data to it.
- s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s.connect(@VAR_RUN@ + "/abrt.socket")
- s.sendall("NEW\0")
- s.sendall("PID=%s\0" % pid)
- s.sendall("EXECUTABLE=%s\0" % executable)
- s.sendall("BACKTRACE=%s\0" % tb)
- s.sendall("ANALYZER=Python\0")
- s.sendall("BASENAME=pyhook\0")
- # This handler puts a short(er) crash descr in 1st line of the backtrace.
- # Example:
- # CCMainWindow.py:1:<module>:ZeroDivisionError: integer division or modulo by zero
- s.sendall("REASON=%s\0" % tb.splitlines()[0])
- s.sendall("DONE\0")
- s.close()
+ command = ["/usr/libexec/abrt-hook-python"]
+ command.append("--pid=%s" % pid)
+ command.append("--executable=%s" % executable)
+
+ helper = subprocess.Popen(command, stdin=subprocess.PIPE)
+ helper.communicate(tb)
+ helper.wait()
+
def handleMyException((etype, value, tb)):
"""