move comments from expressions in f-strings out (#6481)

This commit is contained in:
David Szotten 2023-08-11 08:22:30 +01:00 committed by GitHub
parent 2cedb401bd
commit f091b46497
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

View file

@ -24,3 +24,12 @@ result_f = (
r' \[Previous line repeated (\d+) more times\]' '\n'
'RecursionError: maximum recursion depth exceeded\n'
)
# Regression for fstring dropping comments that were accidentally attached to
# an expression inside a formatted value
(
f'{1}'
# comment
''
)