summaryrefslogtreecommitdiff
path: root/checkers/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'checkers/utils.py')
-rw-r--r--checkers/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/checkers/utils.py b/checkers/utils.py
index 53b40a6..a193220 100644
--- a/checkers/utils.py
+++ b/checkers/utils.py
@@ -154,8 +154,10 @@ def is_defined_before(var_node):
elif isinstance(_node, astroid.With):
for expr, vars in _node.items:
if expr.parent_of(var_node):
- break
- if vars and vars.name == varname:
+ break
+ if (vars and
+ not isinstance(vars, astroid.AssAttr) and
+ vars.name == varname):
return True
elif isinstance(_node, (astroid.Lambda, astroid.Function)):
if _node.args.is_argument(varname):