checker.py 文件源码

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

项目:wuye.vim 作者: zhaoyingnan911 项目源码 文件源码
def TRY(self, node):
        handler_names = []
        # List the exception handlers
        for handler in node.handlers:
            if isinstance(handler.type, ast.Tuple):
                for exc_type in handler.type.elts:
                    handler_names.append(getNodeName(exc_type))
            elif handler.type:
                handler_names.append(getNodeName(handler.type))
        # Memorize the except handlers and process the body
        self.exceptHandlers.append(handler_names)
        for child in node.body:
            self.handleNode(child, node)
        self.exceptHandlers.pop()
        # Process the other nodes: "except:", "else:", "finally:"
        self.handleChildren(node, omit='body')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号