Repository navigation
Commit 26372b1
committed
Since gh-105042, `tokenize` tolerates mismatched brackets. That also let
a mismatched closing bracket pop the brace that opened an f-string
replacement field, which the f-string state relies on. In `f'{]a'`, this
triggered an assertion failure in _PyLexer_scan_string.
Check the replacement field brace in both modes.
(cherry picked from commit 86758d1)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
1 parent 4ba8b7b commit 26372b1
2 files changed
Lines changed: 8 additions & 4 deletions
File tree
- Misc/NEWS.d/next/Core_and_Builtins
- Parser/lexer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
1289 | 1289 | | |
1290 | 1290 | | |
1291 | 1291 | | |
| |||
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
1302 | | - | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1303 | 1306 | | |
1304 | 1307 | | |
1305 | 1308 | | |
| |||
0 commit comments