diff options
author | sylvain thenault <sylvain.thenault@logilab.fr> | 2009-03-06 15:19:26 +0100 |
---|---|---|
committer | sylvain thenault <sylvain.thenault@logilab.fr> | 2009-03-06 15:19:26 +0100 |
commit | 2c2c07af74b64ddaf6ce4100369ac1b0b9d11708 (patch) | |
tree | 454370a41a115f58e760f73dd1ae3129aa3ae3e6 /checkers/variables.py | |
parent | eeef77af9988f0c5eb9d684890c66a0e877f53f6 (diff) | |
download | pylint-2c2c07af74b64ddaf6ce4100369ac1b0b9d11708.tar.gz |
astng2 support
Diffstat (limited to 'checkers/variables.py')
-rw-r--r-- | checkers/variables.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/checkers/variables.py b/checkers/variables.py index d57df66..3f08444 100644 --- a/checkers/variables.py +++ b/checkers/variables.py @@ -136,6 +136,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' # __dict__ is added to module's locals but not available in module's namespace # (unlike __doc__, __name__, etc...). But take care __dict__ may be assigned # somewhere in the module, so remove astng inserted nodes (having None lineno) + # XXX this could probably be handled in astng mlocals['__dict__'] = [n for n in mlocals['__dict__'] if n.lineno is not None] if not mlocals['__dict__']: del mlocals['__dict__'] @@ -315,7 +316,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' astmts = _astmts if len(astmts) == 1: ass = astmts[0].ass_type() - if isinstance(ass, (astng.For, astng.ListCompFor, astng.GenExpr)) \ + if isinstance(ass, (astng.For, astng.Comprehension, astng.GenExpr)) \ and not ass.statement() is node.statement(): self.add_message('W0631', args=name, node=node) |