gh-107967: Fix infinite recursion on invalid escape sequence warning (#107968)

This commit is contained in:
Lysandros Nikolaou 2023-08-15 14:26:42 +03:00 committed by GitHub
parent 13c36dc9ae
commit d66bc9e8a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -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'",