gh-125008: Fix tokenize.untokenize roundtrip for \n{{ (#125013)

This commit is contained in:
Tomas R. 2024-10-06 15:16:41 +02:00 committed by GitHub
parent 39c859f6ff
commit db23b8bb13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 1 deletions

View file

@ -200,7 +200,7 @@ class Untokenizer:
characters[-2::-1]
)
)
if n_backslashes % 2 == 0:
if n_backslashes % 2 == 0 or characters[-1] != "N":
characters.append(character)
else:
consume_until_next_bracket = True