py__iter__ now takes a contextualized_node argument and raises the analysis errors itself
This commit is contained in:
1 parent
12a0357f6b
commit
021d1bc568
10 files changed
+50
-50
No files matched your search
@@ -103,12 +103,14 @@ def _check_for_setattr(instance):
|
||||
|
||||
node = module.tree_node
|
||||
try:
|
||||
stmts = node.get_used_names()['setattr']
|
||||
stmt_names = node.get_used_names()['setattr']
|
||||
except KeyError:
|
||||
return False
|
||||
|
||||
return any(node.start_pos < stmt.start_pos < node.end_pos
|
||||
for stmt in stmts)
|
||||
return any(node.start_pos < n.start_pos < node.end_pos
|
||||
# Check if it's a function called setattr.
|
||||
and not (n.parent.type == 'funcdef' and n.parent.name == n)
|
||||
for n in stmt_names)
|
||||
|
||||
|
||||
def add_attribute_error(name_context, lookup_context, name):
|
||||
|
||||
Reference in new issue
Block a user