Fix exception handling in scheduler

sys.exc_info() return a tuple with (type, value, traceback) where
value is the exception instance. When reraising the exception,
value must be used instead of trying to raise the type instance.

Change-Id: I6a13dfd275fdc368c7eeff9bf1e0b4dc2b1526bc
Story: 2001096
Task: 4757
This commit is contained in:
Thomas Bechtold 2017-06-30 14:24:52 +02:00
parent 0dbe15993a
commit 7f68ec45c2
1 changed files with 3 additions and 3 deletions

View File

@ -49,9 +49,9 @@ class ManagementEvent(object):
def wait(self, timeout=None):
self._wait_event.wait(timeout)
if self._exc_info:
# http://python3porting.com/differences.html#raise
e, v, t = self._exc_info
raise e(v).with_traceback(t)
# sys.exc_info returns (type, value, traceback)
type_, exception_instance, traceback = self._exc_info
raise exception_instance.with_traceback(traceback)
return self._wait_event.is_set()