mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue 27948: Allow backslashes in the literal string portion of f-strings, but not in the expressions. Also, require expressions to begin and end with literal curly braces.
This commit is contained in:
parent
052828db15
commit
451d0e38fc
9 changed files with 321 additions and 341 deletions
|
@ -402,7 +402,7 @@ class StackSummary(list):
|
|||
count += 1
|
||||
else:
|
||||
if count > 3:
|
||||
result.append(f' [Previous line repeated {count-3} more times]'+'\n')
|
||||
result.append(f' [Previous line repeated {count-3} more times]\n')
|
||||
last_file = frame.filename
|
||||
last_line = frame.lineno
|
||||
last_name = frame.name
|
||||
|
@ -419,7 +419,7 @@ class StackSummary(list):
|
|||
row.append(' {name} = {value}\n'.format(name=name, value=value))
|
||||
result.append(''.join(row))
|
||||
if count > 3:
|
||||
result.append(f' [Previous line repeated {count-3} more times]'+'\n')
|
||||
result.append(f' [Previous line repeated {count-3} more times]\n')
|
||||
return result
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue