def try_and_panic_by_hand(self): try: self.line_of_primary_exc = inspect.currentframe().f_lineno + 1 raise ValueError("primary") except Exception: exc_type, exc_value, traceback = sys.exc_info() try: raise RuntimeError("secondary") except Exception: pass raise_(exc_type, exc_value, traceback)
def join(self, *args: Optional[float], **kwargs: Optional[float]) -> None: super().join(*args, **kwargs) if not self.is_alive() and self.exc_info is not None: exc_type, exc_value, traceback = self.exc_info self.exc_info = None raise_(exc_type, exc_value, traceback)
def join(self, *args, **kwargs): super(ExceptionalThread, self).join(*args, **kwargs) if not self.is_alive() and self.exc_info is not None: exc_type, exc_value, traceback = self.exc_info self.exc_info = None raise_(exc_type, exc_value, traceback)