mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-107967: Fix infinite recursion on invalid escape sequence warning (#107968)
This commit is contained in:
parent
13c36dc9ae
commit
d66bc9e8a7
2 changed files with 13 additions and 0 deletions
|
@ -1539,6 +1539,9 @@ error:
|
|||
static int
|
||||
warn_invalid_escape_sequence(struct tok_state *tok, int first_invalid_escape_char)
|
||||
{
|
||||
if (!tok->report_warnings) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *msg = PyUnicode_FromFormat(
|
||||
"invalid escape sequence '\\%c'",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue