diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-22 10:33:23 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-22 10:33:23 +0100 |
commit | 9719184f652c666284785d33767fbcfd1d5fb3ea (patch) | |
tree | c1bd7a1d295e507e5caebd6de91983d7b1d7a0c1 /examples | |
parent | 529ec1d5672718b1d99a17edc0b642e6d369a1e9 (diff) | |
download | pylint-9719184f652c666284785d33767fbcfd1d5fb3ea.tar.gz |
update custom checker in example/custom.py
We don't use compiler.ast nodes, but astng nodes.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/custom.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/custom.py b/examples/custom.py index 73b64e1..7e4d5e7 100644 --- a/examples/custom.py +++ b/examples/custom.py @@ -17,15 +17,13 @@ class MyASTNGChecker(BaseChecker): priority = -1 def visit_callfunc(self, node): - """called when a CallFunc node is encountered. See compiler.ast - documentation for a description of available nodes: - http://www.python.org/doc/current/lib/module-compiler.ast.html - ) - """ - if not (isinstance(node.node, astng.Getattr) - and isinstance(node.node.expr, astng.Name) - and node.node.expr.name == 'properties' - and node.node.attrname == 'create'): + """called when a CallFunc node is encountered. + + See logilab.astng for the description of available nodes.""" + if not (isinstance(node.func, astng.Getattr) + and isinstance(node.func.expr, astng.Name) + and node.func.expr.name == 'properties' + and node.func.attrname == 'create'): return in_class = node.frame() for param in node.args: |