[3.12] gh-129093: Fix f-string debug text sometimes getting cut off when expression contains ! (#129164)

This commit is contained in:
Pablo Galindo Salgado 2025-01-22 00:47:20 +00:00 committed by GitHub
parent b849a1b751
commit e577ff4ce4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 3 deletions

View file

@ -480,9 +480,7 @@ static int update_fstring_expr(struct tok_state *tok, char cur) {
case '}':
case '!':
case ':':
if (tok_mode->last_expr_end == -1) {
tok_mode->last_expr_end = strlen(tok->start);
}
tok_mode->last_expr_end = strlen(tok->start);
break;
default:
Py_UNREACHABLE();