visualstudio_py_debugger.py 文件源码

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

项目:xidian-sfweb 作者: Gear420 项目源码 文件源码
def print_exception(exc_type, exc_value, exc_tb):
    # remove debugger frames from the top and bottom of the traceback
    tb = traceback.extract_tb(exc_tb)
    for i in [0, -1]:
        while tb:
            frame_file = path.normcase(tb[i][0])
            if not any(is_same_py_file(frame_file, f) for f in DONT_DEBUG):
                break
            del tb[i]

    # print the traceback
    if tb:
        print('Traceback (most recent call last):')
        for out in traceback.format_list(tb):
            sys.stderr.write(out)

    # print the exception
    for out in traceback.format_exception_only(exc_type, exc_value):
        sys.stdout.write(out)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号