You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error is reproducible with Pythons 3.11 and 3.12. Also with latest version from git installed with pip install -U git+https://github.com/google/yapf/ which gives the version:
Current behaviour
Yapf crashes when attempting to format a function which contains an unexpected
await
.cat > my_bad.py
Install latest
yapf
from PyPI into a clean Python 3.12 venv and run it againstmy_bad.py
:An
IndexError
is raised. Here's the full traceback:Error is reproducible with Pythons 3.11 and 3.12. Also with latest version from git installed with
pip install -U git+https://github.com/google/yapf/
which gives the version:Expected behaviour
We would expect Yapf to do a nice job of warning of the bad syntax, rather than raising an exception.
For example, if we run with Python:
And if we write "bad" Python, then Yapf usually warns us:
cat > other.py
The text was updated successfully, but these errors were encountered: