-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an invalid quote escaping bug in f-string expressions (#3509)
Fixes #3506 We can't simply escape the quotes in a naked f-string when merging string groups, because backslashes are invalid. The quotes in f-string expressions should be toggled (this is safe since quotes can't be reused). This fix also means implicitly concatenated f-strings with different quotes can now be merged or quote-normalized by changing the quotes used in expressions. e.g.: ```diff raise sa_exc.UnboundExecutionError( "Could not locate a bind configured on " - f'{", ".join(context)} or this Session.' + f"{', '.join(context)} or this Session." ) ```
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters