Blame SOURCES/0274-python-provide-more-information-about-exception.patch

06486d
From e12300d1a8ec7e61db2838cb0b7c3dce193f1464 Mon Sep 17 00:00:00 2001
06486d
From: Martin Kutlak <mkutlak@redhat.com>
06486d
Date: Mon, 10 Apr 2017 13:56:17 +0200
06486d
Subject: [PATCH] python: provide more information about exception
06486d
06486d
Message was modified to provide more information about where exception happened.
06486d
06486d
$ python -c 1/0
06486d
06486d
Before:
06486d
python: detected unhandled Python exception
06486d
06486d
Now:
06486d
python: detected unhandled Python exception in 'interactive mode (python -c ...)'
06486d
06486d
Related to: #1361116
06486d
06486d
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
06486d
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
06486d
06486d
Conflicts:
06486d
	src/hooks/abrt_exception_handler3.py.in
06486d
	tests/runtests/python3-addon/runtest.sh
06486d
---
06486d
 src/hooks/abrt_exception_handler.py.in | 4 +++-
06486d
 1 file changed, 3 insertions(+), 1 deletion(-)
06486d
06486d
diff --git a/src/hooks/abrt_exception_handler.py.in b/src/hooks/abrt_exception_handler.py.in
06486d
index 7455663..dacde37 100644
06486d
--- a/src/hooks/abrt_exception_handler.py.in
06486d
+++ b/src/hooks/abrt_exception_handler.py.in
06486d
@@ -220,7 +220,9 @@ def handleMyException((etype, value, tb)):
06486d
         ## argv0 is:-c
06486d
         # Are there other cases when sys.argv[0][0] is "-"?
06486d
         if not sys.argv[0] or sys.argv[0][0] == "-":
06486d
-            syslog("detected unhandled Python exception")
06486d
+            einfo = "" if not sys.argv[0] else " (python %s ...)" % sys.argv[0]
06486d
+            syslog("detected unhandled Python exception in 'interactive mode%s'"
06486d
+                   % einfo)
06486d
             raise Exception
06486d
 
06486d
         # Ignore scripts with relative path unless "RequireAbsolutePath = no".
06486d
-- 
06486d
1.8.3.1
06486d