[kupfer] task: Default thread_finally handler reraises exception



commit d1bf17e81f6b7566eef73fe843cb50d5464e0795
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Mar 9 00:49:30 2010 +0100

    task: Default thread_finally handler reraises exception
    
    A thread task may handle an exception in the thread as it wishes, but
    the default handler will simply reraise the exception so that it does
    not pass silently.

 kupfer/task.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/task.py b/kupfer/task.py
index 58da7ae..ff13228 100644
--- a/kupfer/task.py
+++ b/kupfer/task.py
@@ -34,7 +34,9 @@ class ThreadTask (Task):
 
 	def thread_finally(self, exc_info):
 		"""Always run at thread finish"""
-		pass
+		if exc_info is not None:
+			etype, value, tb = exc_info
+			raise etype, value, tb
 
 	def _thread_finally(self, exc_info):
 		try:
@@ -48,7 +50,6 @@ class ThreadTask (Task):
 			gobject.idle_add(self.thread_finish)
 		except:
 			exc_info = sys.exc_info()
-			raise
 		else:
 			exc_info = None
 		finally:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]