diff options
Diffstat (limited to 'Python/ast_opt.c')
-rw-r--r-- | Python/ast_opt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 29113706497..77ed29d0cdd 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -268,6 +268,8 @@ parse_literal(PyObject *fmt, Py_ssize_t *ppos, PyArena *arena) PyObject *str = PyUnicode_Substring(fmt, start, pos); /* str = str.replace('%%', '%') */ if (str && has_percents) { + _Py_DECLARE_STR(percent, "%"); + _Py_DECLARE_STR(dbl_percent, "%%"); Py_SETREF(str, PyUnicode_Replace(str, &_Py_STR(dbl_percent), &_Py_STR(percent), -1)); } |