mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module (#113745)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
parent
1f515e8a10
commit
39d102c2ee
11 changed files with 21 additions and 4 deletions
|
@ -844,7 +844,7 @@ _PyPegen_run_parser(Parser *p)
|
|||
if (res == NULL) {
|
||||
if ((p->flags & PyPARSE_ALLOW_INCOMPLETE_INPUT) && _is_end_of_source(p)) {
|
||||
PyErr_Clear();
|
||||
return RAISE_SYNTAX_ERROR("incomplete input");
|
||||
return _PyPegen_raise_error(p, PyExc_IncompleteInputError, 0, "incomplete input");
|
||||
}
|
||||
if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_SyntaxError)) {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue