mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
This commit is contained in:
parent
0aaf13a714
commit
9142088e74
3 changed files with 6 additions and 1 deletions
|
@ -1283,6 +1283,9 @@ _PyPegen_run_parser(Parser *p)
|
|||
reset_parser_state(p);
|
||||
_PyPegen_parse(p);
|
||||
if (PyErr_Occurred()) {
|
||||
if (PyErr_ExceptionMatches(PyExc_SyntaxError)) {
|
||||
_PyPegen_check_tokenizer_errors(p);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (p->fill == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue