test_fatoptimizer.py 文件源码

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

项目:fatoptimizer 作者: vstinner 项目源码 文件源码
def test_transformer_call_visitor(self):
        class BuggyTransformer(fatoptimizer.tools.NodeTransformer):
            def visit_Module(self, node):
                # visit_Module() calls indirectly visit_BinOp(),
                # but the exception must only be wrapped once
                self.generic_visit(node)

            def visit_BinOp(self, node):
                raise Exception("bug")

        visitor = BuggyTransformer("<string>")
        self.check_call_visitor(visitor)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号