diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2024-01-30 16:21:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 16:21:30 (GMT) |
commit | 39d102c2ee8eec8ab0bacbcd62d62a72742ecc7c (patch) | |
tree | f1dab9719fa4b0bda6f06be2b6f99465053761d9 /Objects | |
parent | 1f515e8a109204f7399d85b7fd806135166422d9 (diff) | |
download | cpython-39d102c2ee8eec8ab0bacbcd62d62a72742ecc7c.zip cpython-39d102c2ee8eec8ab0bacbcd62d62a72742ecc7c.tar.gz cpython-39d102c2ee8eec8ab0bacbcd62d62a72742ecc7c.tar.bz2 |
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>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/exceptions.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index a685ed8..cff55d0 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -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) |