diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-03 17:28:22 +0800 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-04 06:52:05 -0700 |
commit | b8312b183d8a9a3b45ea1c1876570be9ddf06317 (patch) | |
tree | d93988f81502d82dffc281646a4537ebea644003 /astroid/transforms.py | |
parent | a98a76baacf0e77548f8e084b4adf44608e5810b (diff) | |
download | astroid-git-b8312b183d8a9a3b45ea1c1876570be9ddf06317.tar.gz |
Remove warnings for nodes that were replaced multiple time
It is possible to have nodes that are transformed multiple times,
so this warning doesn't make that much sense. It is also a bit useless
in case we replace the node even once, since it only verifies that the returned
node from a transform is the same node that was passed in.
Diffstat (limited to 'astroid/transforms.py')
-rw-r--r-- | astroid/transforms.py | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/astroid/transforms.py b/astroid/transforms.py index 852b9854..b860437a 100644 --- a/astroid/transforms.py +++ b/astroid/transforms.py @@ -5,7 +5,6 @@ import collections -import warnings class TransformVisitor(object): @@ -30,17 +29,12 @@ class TransformVisitor(object): return node transforms = self.transforms[cls] - 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 - warnings.warn('node %s substituted multiple times' % node) node = ret return node |