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 a3eecc0..68b5469 100644
--- a/checkers/utils.py
+++ b/checkers/utils.py
@@ -151,8 +151,10 @@ def is_defined_before(var_node):
if ass_node.name == varname:
return True
elif isinstance(_node, astroid.With):
- if not _node.expr.parent_of(var_node):
- if _node.vars and _node.vars.name == varname:
+ for expr, vars in _node.items:
+ if expr.parent_of(var_node):
+ break
+ if vars and vars.name == varname:
return True
elif isinstance(_node, (astroid.Lambda, astroid.Function)):
if _node.args.is_argument(varname):