doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0051-python-support-exceptions-without-traceback.patch

baab13
From a9f19fb25ee6e956d29931f06a8cd919c38fba53 Mon Sep 17 00:00:00 2001
baab13
From: Jakub Filak <jfilak@redhat.com>
baab13
Date: Wed, 9 Jul 2014 17:55:36 +0200
baab13
Subject: [ABRT PATCH 51/66] python: support exceptions without traceback
baab13
baab13
e.g. SyntaxError (python-2.7.5-13.fc20, python-2.7.7-2.fc21)
baab13
baab13
Signed-off-by: Jakub Filak <jfilak@redhat.com>
baab13
---
baab13
 src/hooks/abrt_exception_handler.py.in | 14 ++++++++------
baab13
 1 file changed, 8 insertions(+), 6 deletions(-)
baab13
baab13
diff --git a/src/hooks/abrt_exception_handler.py.in b/src/hooks/abrt_exception_handler.py.in
baab13
index 96a63ff..6cf36d0 100644
baab13
--- a/src/hooks/abrt_exception_handler.py.in
baab13
+++ b/src/hooks/abrt_exception_handler.py.in
baab13
@@ -55,12 +55,14 @@ def write_dump(tb_text, tb):
baab13
         executable = sys.argv[0]
baab13
 
baab13
     dso_list = None
baab13
-    try:
baab13
-        import rpm
baab13
-        dso_list = get_dso_list(tb)
baab13
-    except ImportError as imperr:
baab13
-        syslog("RPM module not available, cannot query RPM db for package "\
baab13
-               "names")
baab13
+    # Trace back is None in case of SyntaxError exception.
baab13
+    if tb:
baab13
+        try:
baab13
+            import rpm
baab13
+            dso_list = get_dso_list(tb)
baab13
+        except ImportError as imperr:
baab13
+            syslog("RPM module not available, cannot query RPM db for package "\
baab13
+                   "names")
baab13
 
baab13
     # Open ABRT daemon's socket and write data to it
baab13
     try:
baab13
-- 
baab13
1.8.3.1
baab13