PyCQA / redbaron

Bottom-up approach to refactoring in python
http://redbaron.pycqa.org/
694 stars 74 forks source link

Comments in if-statements can chrash redbaron #134

Open runekaagaard opened 7 years ago

runekaagaard commented 7 years ago

This is valid python code, but chrashes redbaron:

if 42:
    print 1
# This comment breaks the parser.
else:
    print 2
Psycojoker commented 7 years ago

Hello,

Thanks for reporting :) This is actually a baron's bug, you can find it here https://github.com/PyCQA/baron/issues/96 or there https://github.com/PyCQA/baron/issues/11

runekaagaard commented 7 years ago

Ok, thanks for the references!

Psycojoker commented 7 years ago

@runekaagaard I've pushed a fix on baron, can you test it and tells me if it works for you plz?