debug.py 文件源码

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

项目:asynq 作者: quora 项目源码 文件源码
def dump_stack(skip=0, limit=None):
    """Dumps current stack trace."""
    skip += 2  # To skip dump_stack and traceback.extract_stack
    if limit is None:
        limit = options.STACK_DUMP_LIMIT
    print('--- Stack trace: -----------------------------------------------------')
    try:
        stack = traceback.extract_stack(limit=None if limit is None else limit + skip)
        print(''.join(traceback.format_list(stack[:-skip])), end='')
    finally:
        print('----------------------------------------------------------------------')
        stdout.flush()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号