summaryrefslogtreecommitdiff
path: root/checkers/imports.py
diff options
context:
space:
mode:
authorTorsten Marek <shlomme@gmail.com>2014-03-30 11:33:49 -0700
committerTorsten Marek <shlomme@gmail.com>2014-03-30 11:33:49 -0700
commit753a264e10bbe534150ffd449c96fe7e2b3a64a7 (patch)
treeb5ac6a1870267ee2a866bd924fc35f4b847b36cd /checkers/imports.py
parent6bf1d4a8f8e23017ec9dda401c8101593388acbe (diff)
downloadpylint-753a264e10bbe534150ffd449c96fe7e2b3a64a7.tar.gz
Also emit wildcard-import on unresolved imports.
Diffstat (limited to 'checkers/imports.py')
-rw-r--r--checkers/imports.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/checkers/imports.py b/checkers/imports.py
index df4304a..5be2b54 100644
--- a/checkers/imports.py
+++ b/checkers/imports.py
@@ -248,6 +248,9 @@ given file (report RP0402 must not be disabled)'}
and prev.modname == '__future__'):
self.add_message('W0410', node=node)
return
+ for name, _ in node.names:
+ if name == '*':
+ self.add_message('W0401', args=basename, node=node)
modnode = node.root()
importedmodnode = self.get_imported_module(modnode, node, basename)
if importedmodnode is None:
@@ -255,11 +258,9 @@ given file (report RP0402 must not be disabled)'}
self._check_relative_import(modnode, node, importedmodnode, basename)
self._check_deprecated_module(node, basename)
for name, _ in node.names:
- if name == '*':
- self.add_message('W0401', args=basename, node=node)
- continue
- self._add_imported_module(node, '%s.%s' % (importedmodnode.name, name))
- self._check_reimport(node, name, basename, node.level)
+ if name != '*':
+ self._add_imported_module(node, '%s.%s' % (importedmodnode.name, name))
+ self._check_reimport(node, name, basename, node.level)
def get_imported_module(self, modnode, importnode, modname):
try: