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

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