codegen icon indicating copy to clipboard operation
codegen copied to clipboard

TypeError: 'Delete' object is not iterable

Open apepkuss opened this issue 7 years ago • 1 comments

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

apepkuss avatar Jul 21 '17 05:07 apepkuss

Hi, please use https://github.com/berkerpeksag/astor

andreif avatar Aug 02 '17 09:08 andreif