diff options
Diffstat (limited to 'pylint/checkers/newstyle.py')
-rw-r--r-- | pylint/checkers/newstyle.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py index fe8fa1b..30bc6a6 100644 --- a/pylint/checkers/newstyle.py +++ b/pylint/checkers/newstyle.py @@ -18,13 +18,14 @@ import sys import astroid -from astroid import helpers from pylint.interfaces import IAstroidChecker, INFERENCE, INFERENCE_FAILURE, HIGH from pylint.checkers import BaseChecker from pylint.checkers.utils import ( check_messages, node_frame_class, + safe_infer, + has_known_bases ) MSGS = { @@ -82,7 +83,7 @@ class NewStyleConflictChecker(BaseChecker): style class definition. """ if '__slots__' in node and not node.newstyle: - confidence = (INFERENCE if helpers.has_known_bases(node) + confidence = (INFERENCE if has_known_bases(node) else INFERENCE_FAILURE) self.add_message('slots-on-old-class', node=node, confidence=confidence) @@ -101,7 +102,7 @@ class NewStyleConflictChecker(BaseChecker): if (isinstance(parent, astroid.ClassDef) and not parent.newstyle and isinstance(node.func, astroid.Name)): - confidence = (INFERENCE if helpers.has_known_bases(parent) + confidence = (INFERENCE if has_known_bases(parent) else INFERENCE_FAILURE) name = node.func.name if name == 'property': @@ -128,7 +129,7 @@ class NewStyleConflictChecker(BaseChecker): isinstance(call.func, astroid.Name) and call.func.name == 'super'): continue - confidence = (INFERENCE if helpers.has_known_bases(klass) + confidence = (INFERENCE if has_known_bases(klass) else INFERENCE_FAILURE) if not klass.newstyle: # super should not be used on an old style class |