diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-04-23 00:08:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 00:08:27 (GMT) |
commit | 0fd38917582aae0728e20d8a641e56d9be9270c7 (patch) | |
tree | 94f2f8734143c52e4854c5a567e507b275df7b59 /Parser | |
parent | 7bf94568a9a4101c72b8bf555a811028e5b45ced (diff) | |
download | cpython-0fd38917582aae0728e20d8a641e56d9be9270c7.zip cpython-0fd38917582aae0728e20d8a641e56d9be9270c7.tar.gz cpython-0fd38917582aae0728e20d8a641e56d9be9270c7.tar.bz2 |
gh-102310: Change error range for invalid bytes literals (#103663)
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/string_parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c index be5f0c4..d4ce338 100644 --- a/Parser/string_parser.c +++ b/Parser/string_parser.c @@ -248,7 +248,8 @@ _PyPegen_parse_string(Parser *p, Token *t) const char *ch; for (ch = s; *ch; ch++) { if (Py_CHARMASK(*ch) >= 0x80) { - RAISE_SYNTAX_ERROR( + RAISE_SYNTAX_ERROR_KNOWN_LOCATION( + t, "bytes can only contain ASCII " "literal characters"); return NULL; |