-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Black crashes when "fmt: off/on" is used with "with" expression #3236
Comments
@felix-hilden I don't think this is a duplicate. The example also fails when I move the directives to the same indentation level:
or
or
|
None of them are truly on the same indentation level in code. Try: # fmt: off
with ...:
pass
# fmt: on |
Yes, that works, thanks. But that was not the intention. I want to format the body of the |
Yes, I get that. But this is how fmt off needs to be used. We've got fmt: skip for one-line skips, perhaps that'll help! |
Describe the bug
Black crashes when "fmt: off/on" is used with "with" expression.
To Reproduce
For example, take this code:
And run it with these arguments:
or check in black console online HERE.
The resulting error is:
Expected behavior
Should not crash. I use "fmt: off" and "fmt: on" to prevent moving multiple "with" into one a single line.
Environment
MacOS
The text was updated successfully, but these errors were encountered: