diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2013-03-28 08:53:41 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2013-03-28 08:53:41 +0100 |
commit | 22e37ca5352d256103c0887908890c76826bc5f1 (patch) | |
tree | adb842627234bdbf93ed63ff984066182ed00c0f /node_classes.py | |
parent | 94ee18738092cd150a0ca41d86121638d0390cac (diff) | |
download | astroid-git-22e37ca5352d256103c0887908890c76826bc5f1.tar.gz |
[cleanup] don't call const_factory with astng nodes
--HG--
branch : stable
Diffstat (limited to 'node_classes.py')
-rw-r--r-- | node_classes.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/node_classes.py b/node_classes.py index b6ab6099..a4282b62 100644 --- a/node_classes.py +++ b/node_classes.py @@ -894,15 +894,11 @@ _update_const_classes() def const_factory(value): """return an astng node for a python value""" # XXX we should probably be stricter here and only consider stuff in - # CONST_CLS or do better treatment: - # - # * shall we really support nodes as argument? if so, detail cases where - # * this may occurs - # - # * in case where value is not in CONST_CLS, we should rather recall the - # builder on this value than returning an empty node - if isinstance(value, NodeNG): - return value + # CONST_CLS or do better treatment: in case where value is not in CONST_CLS, + # we should rather recall the builder on this value than returning an empty + # node (another option being that const_factory shouldn't be called with something + # not in CONST_CLS) + assert not isinstance(value, NodeNG) try: return CONST_CLS[value.__class__](value) except (KeyError, AttributeError): |