79
82
"""Overrides Thread.run to capture any exception."""
85
88
self.exception = sys.exc_info()
87
90
# Make sure the calling thread is released
92
95
"""Overrides Thread.join to raise any exception caught.
95
97
Calling join(timeout=0) will raise the caught exception or return None
96
98
if the thread is still alive.
102
101
if self.exception is not None:
103
102
exc_class, exc_value, exc_tb = self.exception
104
103
self.exception = None # The exception should be raised only once