,

Python – Re-Raise an Exception

Re-Raise Error


def re_raise_exception(new_exc, exc_info=None):
     if not exc_info:
         exc_info = sys.exc_info()
     _exc_class, _exc, tb = exc_info
     raise new_exc.__class__, new_exc, tb


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *