summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-06-08 00:15:46 (GMT)
committerGitHub <noreply@github.com>2021-06-08 00:15:46 (GMT)
commitffd87b7093109c279caf8e3ca060f408a102388a (patch)
treeb2200c316df8debc1c621da670505b594271b3a2 /Parser
parent165c884154901deae46b5e328a6414d130e6bfff (diff)
downloadcpython-ffd87b7093109c279caf8e3ca060f408a102388a.zip
cpython-ffd87b7093109c279caf8e3ca060f408a102388a.tar.gz
cpython-ffd87b7093109c279caf8e3ca060f408a102388a.tar.bz2
fix: use unambiguous punction in 'invalid escape sequence' message (GH-26582)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/string_parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index b919633..fa41a36 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -12,7 +12,7 @@ static int
warn_invalid_escape_sequence(Parser *p, unsigned char first_invalid_escape_char, Token *t)
{
PyObject *msg =
- PyUnicode_FromFormat("invalid escape sequence \\%c", first_invalid_escape_char);
+ PyUnicode_FromFormat("invalid escape sequence '\\%c'", first_invalid_escape_char);
if (msg == NULL) {
return -1;
}
@@ -27,7 +27,7 @@ warn_invalid_escape_sequence(Parser *p, unsigned char first_invalid_escape_char,
since _PyPegen_raise_error uses p->tokens[p->fill - 1] for the
error location, if p->known_err_token is not set. */
p->known_err_token = t;
- RAISE_SYNTAX_ERROR("invalid escape sequence \\%c", first_invalid_escape_char);
+ RAISE_SYNTAX_ERROR("invalid escape sequence '\\%c'", first_invalid_escape_char);
}
Py_DECREF(msg);
return -1;