[BUG] incorrectly removing trailing `pass`.
sunmy2019 opened this issue · comments
sunmy2019 commented
To Reproduce Steps to reproduce the behavior:
- Take this code snippet:
import random
import time
def foo():
pass
if random.randint(0, 1):
foo()
if random.randint(0, 1):
foo()
else:
pass
- Run this Pycln command:
$ python3.8 -m pycln test.py
- Unexpected fixed code (if present):
import random
def foo():
pass
if random.randint(0, 1):
foo()
if random.randint(0, 1):
foo()
else:
Expected behavior:
The generated python code should be legal.
Environment (please complete the following informations):
- Python Version: python3.8
- Pycln Version: pycln, version 1.1.0
- OS Type: Linux
Hadi Alqattan commented
This already has been solved in v1.2.2