summaryrefslogtreecommitdiff
path: root/rebuilder.py
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2014-03-19 09:48:51 +0100
committerSylvain Thénault <sylvain.thenault@logilab.fr>2014-03-19 09:48:51 +0100
commit6cd480552017e6e44f0bc0c17687fc1c380fb9c7 (patch)
tree190cdf9bfe82bd763a0bf3f7a24fba0c9df516d6 /rebuilder.py
parent6b53e3d94807fa59ef751068199f3c2b759f2f1a (diff)
downloadastroid-git-6cd480552017e6e44f0bc0c17687fc1c380fb9c7.tar.gz
call transformation for builtin modules as well (though not yet for their child nodes)
Diffstat (limited to 'rebuilder.py')
-rw-r--r--rebuilder.py20
1 files changed, 1 insertions, 19 deletions
diff --git a/rebuilder.py b/rebuilder.py
index f6fae7b1..ef8e7635 100644
--- a/rebuilder.py
+++ b/rebuilder.py
@@ -142,25 +142,7 @@ class TreeRebuilder(object):
self._from_nodes = []
self._delayed_assattr = []
self._visit_meths = {}
-
- def _transform(self, node):
- try:
- transforms = self._manager.transforms[type(node)]
- except KeyError:
- return node # no transform registered for this class of node
- orig_node = node # copy the reference
- for transform_func, predicate in transforms:
- if predicate is None or predicate(node):
- ret = transform_func(node)
- # if the transformation function returns something, it's
- # expected to be a replacement for the node
- if ret is not None:
- if node is not orig_node:
- # node has already be modified by some previous
- # transformation, warn about it
- warn('node %s substitued multiple times' % node)
- node = ret
- return node
+ self._transform = manager.transform
def visit_module(self, node, modname, package):
"""visit a Module node by returning a fresh instance of it"""