Raise exception with existing traceback.
    If traceback is not passed, uses sys.exc_info() to get traceback.

def raise_with_traceback(exc, traceback=Ellipsis):
    """
    Raise exception with existing traceback.
    If traceback is not passed, uses sys.exc_info() to get traceback.
    """
    if traceback == Ellipsis:
        _, _, traceback = sys.exc_info()
    raise exc.with_traceback(traceback)