codegen
codegen copied to clipboard
TypeError: 'Delete' object is not iterable
visit_Delete function (in the line 297 of codegen.py) throws a TypeError exception when I run my code. I am trying to fix the bug as below. If you have any concern, please send me a message. Thanks.
def visit_Delete(self, node):
self.newline(node)
self.write('del ')
try:
# BUG fixed: for idx, target in enumerate(node):
for idx, target in enumerate(node.targets):
if idx:
self.write(', ')
self.visit(target)
except TypeError as te:
print te.message
Hi, please use https://github.com/berkerpeksag/astor