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
评论列表
文章目录