diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-06 19:57:11 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-06 19:57:11 +0300 |
commit | 47b1c773606824c22e9ae27707b9429badbc121d (patch) | |
tree | a5fbf3d210fbdff008a660094bf74fc587f8d423 /pylint/checkers/classes.py | |
parent | 6ab79eebb2921208ee68bbfa4143d44ed6cd3592 (diff) | |
download | pylint-git-47b1c773606824c22e9ae27707b9429badbc121d.tar.gz |
Use safe_infer and has_known_bases from astroid.helpers. Closes issue #593.
Diffstat (limited to 'pylint/checkers/classes.py')
-rw-r--r-- | pylint/checkers/classes.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index 962cca578..c4f7ff06f 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -26,13 +26,14 @@ from astroid.bases import Generator, BUILTINS from astroid.exceptions import InconsistentMroError, DuplicateBasesError from astroid import objects from astroid.scoped_nodes import function_to_method +from astroid import helpers from pylint.interfaces import IAstroidChecker from pylint.checkers import BaseChecker from pylint.checkers.utils import ( PYMETHODS, SPECIAL_METHODS_PARAMS, overrides_a_method, check_messages, is_attr_private, - is_attr_protected, node_frame_class, safe_infer, is_builtin_object, + is_attr_protected, node_frame_class, is_builtin_object, decorated_with_property, unimplemented_abstract_methods, decorated_with) from pylint.utils import deprecated_option, get_global_option @@ -335,7 +336,7 @@ a metaclass class method.'} a class or a type. """ for base in node.bases: - ancestor = safe_infer(base) + ancestor = helpers.safe_infer(base) if ancestor in (YES, None): continue if (isinstance(ancestor, astroid.Instance) and @@ -554,7 +555,7 @@ a metaclass class method.'} """ Check that the given assattr node is defined in the class slots. """ - infered = safe_infer(node.expr) + infered = helpers.safe_infer(node.expr) if infered and isinstance(infered, Instance): klass = infered._proxied if '__slots__' not in klass.locals or not klass.newstyle: |