mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-102310: Change error range for invalid bytes literals (#103663)
This commit is contained in:
parent
7bf94568a9
commit
0fd3891758
3 changed files with 27 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue