diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-17 18:41:21 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-17 18:41:21 +0300 |
commit | 17cd1d604acf75913ab30d2caccb017242de0495 (patch) | |
tree | 3649ba9d548ab1ee0121be5dcf2fc756e9f6f142 /pylint/checkers/imports.py | |
parent | f05ee73bf2c440326ce9bb9fe887f584aca743ca (diff) | |
download | pylint-17cd1d604acf75913ab30d2caccb017242de0495.tar.gz |
Don't emit import-error for nodes protected by an except clause which handles ImportError, Exception or bare except.
Diffstat (limited to 'pylint/checkers/imports.py')
-rw-r--r-- | pylint/checkers/imports.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 785fdb7..817d966 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -30,7 +30,7 @@ from astroid.modutils import get_module_part, is_standard_module from pylint.interfaces import IAstroidChecker from pylint.utils import EmptyReport, get_global_option from pylint.checkers import BaseChecker -from pylint.checkers.utils import check_messages, excepts_import_error +from pylint.checkers.utils import check_messages, node_ignores_exception def get_first_import(node, context, name, base, level): @@ -288,7 +288,7 @@ given file (report RP0402 must not be disabled)'} if submodule in ignored_modules: return None - if not excepts_import_error(importnode.parent): + if not node_ignores_exception(importnode, ImportError): self.add_message("import-error", args=args, node=importnode) @staticmethod |