async_traceback.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:botoflow 作者: boto 项目源码 文件源码
def format_exc(limit=None, exception=None, tb_list=None):
    """
    This is like print_exc(limit) but returns a string instead of printing to a
    file.
    """
    result = ["Traceback (most recent call last):\n"]
    if exception is None:
        exception = get_context_with_traceback(get_async_context()).exception

    if tb_list is None:
        tb_list = extract_tb(limit)

    if tb_list:
        result.extend(traceback.format_list(tb_list))
        result.extend(traceback.format_exception_only(exception.__class__,
                                                      exception))
        return result
    else:
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号