diff options
| author | cpopa <devnull@localhost> | 2014-08-08 23:12:37 +0300 |
|---|---|---|
| committer | cpopa <devnull@localhost> | 2014-08-08 23:12:37 +0300 |
| commit | 2b3c049494f126d6b7f784ce250e9419e02e47fd (patch) | |
| tree | 78c957a84fd451beed9df632d13f8e8b48a705bd | |
| parent | e7ffab27ea531e3142e9a439264a0e3458e1a3ac (diff) | |
| download | pylint-2b3c049494f126d6b7f784ce250e9419e02e47fd.tar.gz | |
Check only if the infered node is a class.
| -rw-r--r-- | checkers/imports.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/checkers/imports.py b/checkers/imports.py index 51976a7..d9bdfa6 100644 --- a/checkers/imports.py +++ b/checkers/imports.py @@ -27,9 +27,7 @@ from astroid.modutils import get_module_part, is_standard_module from pylint.interfaces import IAstroidChecker from pylint.utils import EmptyReport from pylint.checkers import BaseChecker -from pylint.checkers.utils import ( - check_messages, inherit_from_std_ex, - is_builtin_object) +from pylint.checkers.utils import check_messages, inherit_from_std_ex def _except_import_error(node): """ @@ -51,7 +49,7 @@ def _except_import_error(node): for name in names: try: for infered in name.infer(): - if (is_builtin_object(infered) and + if (isinstance(infered, astroid.Class) and inherit_from_std_ex(infered) and infered.name == 'ImportError'): return True |
