summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
authorMichal Nowikowski <godfryd@gmail.com>2014-08-01 06:30:10 +0200
committerMichal Nowikowski <godfryd@gmail.com>2014-08-01 06:30:10 +0200
commit9eb9853d52091a24ceffd04679762a7efedc98fd (patch)
tree62bfad82ea4ee61c48bcaab57aa9eed0a2812bc2 /checkers/variables.py
parentcb41910e3fbad8bd6ba041b285b74a439c9d9375 (diff)
downloadpylint-9eb9853d52091a24ceffd04679762a7efedc98fd.tar.gz
Improved presenting unused-import message. Closes issue #293.
Diffstat (limited to 'checkers/variables.py')
-rw-r--r--checkers/variables.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index 338615f..e1ae0ec 100644
--- a/checkers/variables.py
+++ b/checkers/variables.py
@@ -319,14 +319,14 @@ builtins. Remember that you should avoid to define new builtins when possible.'
and isinstance(stmt.ass_type(), astroid.AugAssign)
for stmt in stmts):
continue
- stmt = stmts[0]
- if isinstance(stmt, astroid.Import):
- self.add_message('unused-import', args=name, node=stmt)
- elif isinstance(stmt, astroid.From) and stmt.modname != '__future__':
- if stmt.names[0][0] == '*':
- self.add_message('unused-wildcard-import', args=name, node=stmt)
- else:
- self.add_message('unused-import', args=name, node=stmt)
+ for stmt in stmts:
+ if isinstance(stmt, astroid.Import):
+ self.add_message('unused-import', args=stmt.names[0][0], node=stmt)
+ elif isinstance(stmt, astroid.From) and stmt.modname != '__future__':
+ if stmt.names[0][0] == '*':
+ self.add_message('unused-wildcard-import', args=name, node=stmt)
+ else:
+ self.add_message('unused-import', args=name, node=stmt)
del self._to_consume
def visit_class(self, node):