diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-14 00:26:13 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-14 00:26:13 +0300 |
commit | c90eae70b2d8974027b749f6996488a0b1a8903b (patch) | |
tree | 081919c06e97041a4f0328e9ea2eb58e085a068f | |
parent | c236c62835baaf28458c9abee13c6204da714535 (diff) | |
download | pylint-c90eae70b2d8974027b749f6996488a0b1a8903b.tar.gz |
Get the ignored modules only once and save the result in the imports checker.
-rw-r--r-- | pylint/checkers/imports.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 8e91886..9e2af7e 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -224,6 +224,8 @@ given file (report RP0402 must not be disabled)'} self.linter.add_stats(cycles=[]) self.stats = self.linter.stats self.import_graph = defaultdict(set) + self._ignored_modules = get_global_option( + self, 'ignored-modules', default=[]) def close(self): """called before visiting project (i.e set of modules)""" @@ -282,10 +284,9 @@ given file (report RP0402 must not be disabled)'} args = '%r (%s)' % (modname, ex) else: args = repr(modname) - - ignored_modules = get_global_option(self, 'ignored-modules', default=[]) + for submodule in self._qualified_names(modname): - if submodule in ignored_modules: + if submodule in self._ignored_modules: return None if not node_ignores_exception(importnode, ImportError): |