diff options
author | Anthony Truchet <anthony.truchet@logilab.fr> | 2014-04-11 10:59:13 +0200 |
---|---|---|
committer | Anthony Truchet <anthony.truchet@logilab.fr> | 2014-04-11 10:59:13 +0200 |
commit | 79f5fb18bbb36c5f266b36f62bbcb7b7cdc35c69 (patch) | |
tree | e392818637e43dbd7d08de781e31c0365a2999b5 /checkers/variables.py | |
parent | d56dc79f7687a322c507724f044b7dd22fc9cb2d (diff) | |
download | pylint-git-79f5fb18bbb36c5f266b36f62bbcb7b7cdc35c69.tar.gz |
[variable checker] Fix unused import false positive with augment assignment. Closes #78
Diffstat (limited to 'checkers/variables.py')
-rw-r--r-- | checkers/variables.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/checkers/variables.py b/checkers/variables.py index 469eccaa1..cdf6c22a9 100644 --- a/checkers/variables.py +++ b/checkers/variables.py @@ -1,4 +1,4 @@ -# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). +# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program is free software; you can redistribute it and/or modify it under @@ -242,6 +242,10 @@ builtins. Remember that you should avoid to define new builtins when possible.' if not self.config.init_import and node.package: return for name, stmts in not_consumed.iteritems(): + if any(isinstance(stmt, astroid.AssName) + and isinstance(stmt.ass_type(), astroid.AugAssign) + for stmt in stmts): + continue stmt = stmts[0] if isinstance(stmt, astroid.Import): self.add_message('W0611', args=name, node=stmt) |