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

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