def reraise(exc_type, exc_value, extra_message=None): """ Raise an exception of type `exc_type` with arguments of `exc_value` plus maybe `extra_message` at the beginning. """ args = exc_value.args if extra_message: args = (extra_message, ) + args six_reraise(exc_type, args, exc_info()[2])
def reraise(exc_type, exc_value, extra_message=None): """ Raise an exception of type `exc_type` with arguments of `exc_value` plus maybe `extra_message` at the beginning. """ args = exc_value.args if isinstance(exc_value, StatusMessageException): args = (exc_value.message, ) + args if extra_message: args = (extra_message, ) + args six_reraise(exc_type, exc_type(*args), exc_info()[2])
def reraise(self): """ Re-raise the wrapped exception. This is intended to be called after some sort of cleanup has been done. """ six_reraise(type(self.exception), self.exception, exc_info()[2])