-
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
INTERNAL ERROR: Black produced invalid code: f-string: expecting '}' #4151
Comments
Duplicate of #3746 |
@hauntsaninja Hi! This is not 3.12 code. This is normal f string formatting. |
Could you share what your input code was? |
As listed above. Just put that into a file and try. email = "test@example.com"
query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
filter=f"mail eq '{email}' or startswith(userPrincipalName, '{email.split("
@ ")[0]}')",
count=True, # required
) |
Ahh but maybe this can be closed. It's also detected as a SyntaxError now, but maybe the message is wrong?
|
That code is valid only in 3.12+, so Shantanu was correct in closing this. |
Okay sorry. I didn't know that I wrote 3.12 code |
Describe the bug
Internal crash
To Reproduce
Run the code down below
For example, take this code:
And run it with these arguments:
$ black .
The resulting error is:
Expected behavior
It should format correctly
Environment
The text was updated successfully, but these errors were encountered: