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
commite68b3cf2324bc0637b14d1779704453aca9fb725 (patch)
tree60c027761c53e8f32a499e690e7a9efea2347222 /utils.py
parent0f0e27252189dad9a04e77c8ab073323d17e9db6 (diff)
downloadastroid-e68b3cf2324bc0637b14d1779704453aca9fb725.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 d7a174c..41eb7eb 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