gh-105800: Issue SyntaxWarning in f-strings for invalid escape sequences by pablogsal · Pull Request #105801 · python/cpython
static expr_ty _PyPegen_decode_fstring_part(Parser* p, int is_raw, expr_ty constant) { _PyPegen_decode_fstring_part(Parser* p, int is_raw, expr_ty constant, Token* token) { assert(PyUnicode_CheckExact(constant->v.Constant.value));
const char* bstr = PyUnicode_AsUTF8(constant->v.Constant.value);
is_raw = is_raw || strchr(bstr, '\\') == NULL; PyObject *str = _PyPegen_decode_string(p, is_raw, bstr, len, NULL); PyObject *str = _PyPegen_decode_string(p, is_raw, bstr, len, token); if (str == NULL) { _Pypegen_raise_decode_error(p); return NULL;