berkerpeksag / astor

Python AST read/write
https://pypi.org/project/astor/
BSD 3-Clause "New" or "Revised" License
810 stars 102 forks source link

Calls that aren't part of anything in the body of a FunctionDef don't get a new line. #47

Closed vincelugli closed 9 years ago

vincelugli commented 9 years ago

When creating a FunctionDef ast, if you have a Call as part of the body, the Call will not be on a new line.

def foo():
    bar()

will appear as

def foo():bar()
vincelugli commented 9 years ago

Call needs to be wrapped in an expression, sorry for the spam!

berkerpeksag commented 9 years ago

No problem, I'm glad you solved it :)