-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C: crashBlack is crashingBlack is crashingC: preview styleIssues with the preview and unstable style. Add the name of the responsible feature in the title.Issues with the preview and unstable style. Add the name of the responsible feature in the title.T: bugSomething isn't workingSomething isn't working
Description
Describe the bug
black --preview crashes on seeing await (yield)
This is certainly not good code or anything, but is code we have in one of our test files in flake8-trio. Non-preview black has no issues with it.
To Reproduce
For example, take this code:
async def foo():
await (yield)And run it with these arguments:
$ black --preview myfile.py The resulting error is:
error: cannot format myfile.py: blib2to3.pytree.Node object expected; got blib2to3.pytree.Leaf
Oh no! 💥 💔 💥
1 file failed to reformat.
Expected behavior
Not crashing
Environment
$ black --version
black, 22.12.0 (compiled: yes)
Python (CPython) 3.11.0
$ python --version
Python 3.11.0
$ uname -sro
Linux 6.1.1-arch1-1 GNU/LinuxReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C: crashBlack is crashingBlack is crashingC: preview styleIssues with the preview and unstable style. Add the name of the responsible feature in the title.Issues with the preview and unstable style. Add the name of the responsible feature in the title.T: bugSomething isn't workingSomething isn't working