SyntaxError
thrown during normal parsing.
The exception argument is either a string describing the reason of the
failure or a tuple containing a tuple causing the failure from a parse
tree passed to tuple2ast()
and an explanatory string. Calls to
tuple2ast()
need to be able to handle either type of exception,
while calls to other functions in the module will only need to be
aware of the simple string values.
compileast()
, expr()
, and
suite()
may throw exceptions which are normally thrown by the
parsing and compilation process. These include the built in
exceptions MemoryError
, OverflowError
,
SyntaxError
, and SystemError
. In these cases, these
exceptions carry all the meaning normally associated with them. Refer
to the descriptions of each function for detailed information.