test_zipimport.py 文件源码

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

项目:oil 作者: oilshell 项目源码 文件源码
def doTraceback(self, module):
        try:
            module.do_raise()
        except:
            tb = sys.exc_info()[2].tb_next

            f,lno,n,line = extract_tb(tb, 1)[0]
            self.assertEqual(line, raise_src.strip())

            f,lno,n,line = extract_stack(tb.tb_frame, 1)[0]
            self.assertEqual(line, raise_src.strip())

            s = StringIO.StringIO()
            print_tb(tb, 1, s)
            self.assertTrue(s.getvalue().endswith(raise_src))
        else:
            raise AssertionError("This ought to be impossible")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号