mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-93418: Fix an assert when an f-string expression is followed by an '=', but no closing brace. (gh-93419) (gh-93423)
(cherry picked from commit ee70c70aa9
)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
This commit is contained in:
parent
0b7aae88d0
commit
855be47a02
3 changed files with 6 additions and 1 deletions
|
@ -740,7 +740,9 @@ fstring_find_expr(Parser *p, const char **str, const char *end, int raw, int rec
|
|||
while (Py_ISSPACE(**str)) {
|
||||
*str += 1;
|
||||
}
|
||||
|
||||
if (*str >= end) {
|
||||
goto unexpected_end_of_string;
|
||||
}
|
||||
/* Set *expr_text to the text of the expression. */
|
||||
*expr_text = PyUnicode_FromStringAndSize(expr_start, *str-expr_start);
|
||||
if (!*expr_text) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue