Hi there,
I found a bug in above module, for method visit_ifexp:
Original (logilab_astng-0.19.3-py2.6.egg/logilab/astng/nodes_as_string.py):
(line 241)
def visit_ifexp(self, node):
"""return an astng.IfExp node as string"""
ifs = ['%s if %s' % (self._stmt_list(node.body),
node.test.accept(self))]
if node.orelse:
ifs.append('else %s' % self._stmt_list(node.orelse))
return ' '.join(ifs)
My fix:
def visit_ifexp(self, node):
"""return an astng.IfExp node as string"""
return '%s if %s else %s' % (node.body.accept(self),
node.test.accept(self), node.orelse.accept(self))
Since we deal here with arithmetic expressions for node.body and node.orelse
they must be 'accepted'.I think the code has been copied from vist_if and
was not modified afterwards.
Best regards,
Winfried
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects