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

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