diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-04-15 16:19:57 +0200 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-04-15 16:19:57 +0200 |
commit | 73334c2f3cc82c037d25d4a1925bc186c057971d (patch) | |
tree | 85b9cfdaf184fee50040565d18359b10f1e72647 /checkers/utils.py | |
parent | 21093b15a04d9c48dbbde8583d17d185d6245be9 (diff) | |
download | pylint-73334c2f3cc82c037d25d4a1925bc186c057971d.tar.gz |
fix #20067: pylint crash with AttributeError
in a with statement without 'as', node.vars is None
Diffstat (limited to 'checkers/utils.py')
-rw-r--r-- | checkers/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/checkers/utils.py b/checkers/utils.py index 92ff272..740df6a 100644 --- a/checkers/utils.py +++ b/checkers/utils.py @@ -99,6 +99,9 @@ def is_defined_before(var_node, comp_node_types=COMP_NODE_TYPES): if ass_node.name == varname: return True elif isinstance(_node, astng.With): + if _node.vars is None: + # quickfix : case in which 'with' is used without 'as' + return False if _node.vars.name == varname: return True elif isinstance(_node, (astng.Lambda, astng.Function)): |