diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-08-25 21:06:19 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-08-25 21:06:19 +0300 |
commit | 7378c72503e7dd7c878e3170bafea15293dda99a (patch) | |
tree | e10c3e69876884cea670b2edd80cdfa7cb0b285e /pylint/checkers/newstyle.py | |
parent | 5ab5ffd3b3e6744213d0a3148d0cf46348534a16 (diff) | |
download | pylint-git-7378c72503e7dd7c878e3170bafea15293dda99a.tar.gz |
Update pylint to use the new astroid AST names and methods
Also improve a couple of imports and added support for the
old visit_ names. Priority will have the old visit_ names, such
as visit_discard over visit_expr, visit_callfunc over visit_call
etc.
Diffstat (limited to 'pylint/checkers/newstyle.py')
-rw-r--r-- | pylint/checkers/newstyle.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py index 035aea27d..5e88a32f6 100644 --- a/pylint/checkers/newstyle.py +++ b/pylint/checkers/newstyle.py @@ -98,7 +98,7 @@ class NewStyleConflictChecker(BaseChecker): def visit_callfunc(self, node): """check property usage""" parent = node.parent.frame() - if (isinstance(parent, astroid.Class) and + if (isinstance(parent, astroid.ClassDef) and not parent.newstyle and isinstance(node.func, astroid.Name)): confidence = (INFERENCE if helpers.has_known_bases(parent) @@ -115,16 +115,16 @@ class NewStyleConflictChecker(BaseChecker): if not node.is_method(): return klass = node.parent.frame() - for stmt in node.nodes_of_class(astroid.CallFunc): + for stmt in node.nodes_of_class(astroid.Call): if node_frame_class(stmt) != node_frame_class(node): # Don't look down in other scopes. continue expr = stmt.func - if not isinstance(expr, astroid.Getattr): + if not isinstance(expr, astroid.Attribute): continue call = expr.expr # skip the test if using super - if isinstance(call, astroid.CallFunc) and \ + if isinstance(call, astroid.Call) and \ isinstance(call.func, astroid.Name) and \ call.func.name == 'super': confidence = (INFERENCE if helpers.has_known_bases(klass) |