bugbear.py 文件源码

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

项目:flake8-bugbear 作者: PyCQA 项目源码 文件源码
def visit_Attribute(self, node):
        call_path = list(self.compose_call_path(node))
        if '.'.join(call_path) == 'sys.maxint':
            self.errors.append(
                B304(node.lineno, node.col_offset)
            )
        elif len(call_path) == 2 and call_path[1] == 'message':
            name = call_path[0]
            for elem in reversed(self.node_stack[:-1]):
                if isinstance(elem, ast.ExceptHandler) and elem.name == name:
                    self.errors.append(
                        B306(node.lineno, node.col_offset)
                    )
                    break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号