debug.py 文件源码

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

项目:Krawler 作者: Cirice 项目源码 文件源码
def print_stack_trace():
    """
    Prints the stack trace of the programme when an error occurred
    :return: None
    """

    try:
        ct = StringIO()
        ct.seek(0)
        traceback.print_exc(file=ct)
    except:
        traceback.print_exc(file=sys.stderr)
    else:
        tc.cprint("\nERROR:", "red")
        tc.cprint(str(ct.getvalue()), "yellow")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号