Python 3.13+Exceptionsexception
_IncompleteInputError
built-in exceptions
Internal: source is syntactically incomplete (used by the REPL for multi-line input).
Syntax
raise _IncompleteInputError
The leading underscore marks it as CPython plumbing: the interpreter uses it to tell "the source simply ran out mid-construct" apart from a real syntax error, so the interactive prompt asks for a continuation line instead of reporting a failure. It is a subclass of SyntaxError, so a plain except SyntaxError already covers it. Do not reference the name in your own code — private names come and go between versions without notice.
Examples
try:
raise _IncompleteInputError
except _IncompleteInputError as e:
print(type(e).__name__) # → _IncompleteInputError
See also
Open in the full glossarydocs.python.orgReport an inaccuracy