mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +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
|
@ -2566,6 +2566,11 @@ MiddlingExtendsException(PyExc_SyntaxError, IndentationError, SyntaxError,
|
|||
MiddlingExtendsException(PyExc_IndentationError, TabError, SyntaxError,
|
||||
"Improper mixture of spaces and tabs.");
|
||||
|
||||
/*
|
||||
* IncompleteInputError extends SyntaxError
|
||||
*/
|
||||
MiddlingExtendsException(PyExc_SyntaxError, IncompleteInputError, SyntaxError,
|
||||
"incomplete input.");
|
||||
|
||||
/*
|
||||
* LookupError extends Exception
|
||||
|
@ -3635,6 +3640,7 @@ static struct static_exception static_exceptions[] = {
|
|||
|
||||
// Level 4: Other subclasses
|
||||
ITEM(IndentationError), // base: SyntaxError(Exception)
|
||||
ITEM(IncompleteInputError), // base: SyntaxError(Exception)
|
||||
ITEM(IndexError), // base: LookupError(Exception)
|
||||
ITEM(KeyError), // base: LookupError(Exception)
|
||||
ITEM(ModuleNotFoundError), // base: ImportError(Exception)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue