summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-11-22 15:18:37 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-11-22 15:18:37 +0100
commite87f9321919e5f2b1fc3c6e3b88a5cdf9d6e413e (patch)
treee0e15b3bd0957fb1c148cd7656d5448c3df3ee37 /utils.py
parent689d969225d8c999eb519cadc1ba43088b53fe5e (diff)
downloadastroid-git-e87f9321919e5f2b1fc3c6e3b88a5cdf9d6e413e.tar.gz
cleanup: remove unused IgnoreChild exception
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/utils.py b/utils.py
index d7a174c7..41eb7eb3 100644
--- a/utils.py
+++ b/utils.py
@@ -36,7 +36,7 @@ extract information from it
__docformat__ = "restructuredtext en"
-from logilab.astng._exceptions import IgnoreChild, ASTNGBuildingException
+from logilab.astng._exceptions import ASTNGBuildingException
class ASTVisitor(object):
"""Abstract Base Class for Python AST Visitors.
@@ -249,19 +249,11 @@ class ASTWalker:
if node in _done:
raise AssertionError((id(node), node, node.parent))
_done.add(node)
- try:
- self.visit(node)
- except IgnoreChild:
- pass
- else:
- try:
- for child_node in node.get_children():
- self.handler.set_context(node, child_node)
- assert child_node is not node
- self.walk(child_node, _done)
- except AttributeError:
- print node.__class__, id(node.__class__)
- raise
+ self.visit(node)
+ for child_node in node.get_children():
+ self.handler.set_context(node, child_node)
+ assert child_node is not node
+ self.walk(child_node, _done)
self.leave(node)
assert node.parent is not node
@@ -343,8 +335,6 @@ def _check_children(node):
_check_children(child)
-# XXX This class don't support 'compiler' for now.
-# If we want it, there is a "_native_repr_tree" method in _nodes_compiler.py
class TreeTester(object):
'''A helper class to see _ast tree and compare with astng tree