summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
authorAnthony Truchet <anthony.truchet@logilab.fr>2014-04-11 10:59:13 +0200
committerAnthony Truchet <anthony.truchet@logilab.fr>2014-04-11 10:59:13 +0200
commit72f1d4f950bdd888aad2bfd1f70dcaa8c8d31dba (patch)
tree7e5ab33d954de7337bcffcd3b6adf0e82d63c579 /checkers/variables.py
parent2661908945c68572c2bf91abcadb61bf56db4aa0 (diff)
downloadpylint-72f1d4f950bdd888aad2bfd1f70dcaa8c8d31dba.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.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index 469ecca..cdf6c22 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)