diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2013-06-18 18:18:45 +0200 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2013-06-18 18:18:45 +0200 |
commit | 97c3f5dddd151494effe5150663f83c71e77354c (patch) | |
tree | 566cbe4ef5dfc41a23d8af3824c059b15cbe6e6a /brain/py2stdlib.py | |
parent | fc02b9e6bc453e0413e324c7a458b5871277744c (diff) | |
download | astroid-git-97c3f5dddd151494effe5150663f83c71e77354c.tar.gz |
[transforms] allow transformation functions on any nodes, not only modules
Diffstat (limited to 'brain/py2stdlib.py')
-rw-r--r-- | brain/py2stdlib.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/brain/py2stdlib.py b/brain/py2stdlib.py index 25c7122d..b3da2a53 100644 --- a/brain/py2stdlib.py +++ b/brain/py2stdlib.py @@ -5,11 +5,14 @@ Currently help understanding of : * hashlib.md5 and hashlib.sha1 """ -from astroid import MANAGER +from astroid import MANAGER, nodes from astroid.builder import AstroidBuilder MODULE_TRANSFORMS = {} + +# module specific transformation functions ##################################### + def hashlib_transform(module): fake = AstroidBuilder(MANAGER).string_build(''' @@ -177,6 +180,6 @@ def transform(module): tr(module) from astroid import MANAGER -MANAGER.register_transformer(transform) +MANAGER.register_transform(nodes.Module, transform) |