import traceback


def collect_exception_python3(exception):
    """
    Collect exception from exception __traceback__.
    :param exception: Exception from Flask.
    :return: traceback data
    """

    traceback_data = ''.join(traceback.format_exception(
        type(exception),
        exception,
        exception.__traceback__,
    ))
    return traceback_data