]> granicus.if.org Git - python/commit
Added Py_UseClassExceptionsFlag, the variable containing the state of
authorBarry Warsaw <barry@python.org>
Fri, 29 Aug 1997 22:07:17 +0000 (22:07 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 29 Aug 1997 22:07:17 +0000 (22:07 +0000)
commit035574d755bfc306704e9975dc10e4e05a47b3bb
tree6713f73f15f378f31e62fd7df9aad2c7a146e5eb
parentd5a0ff972dee45bb30cad3aea15eb50ea6b6fc82
Added Py_UseClassExceptionsFlag, the variable containing the state of
the -X command line option.

Py_Initialize(): Handle the two phase initialization of the built-in
module.

Py_Finalize(): Handle the two phase finalization of the built-in
module.

parse_syntax_error(): New function which parses syntax errors that
PyErr_Print() will catch.  This correctly parses such errors
regardless of whether PyExc_SyntaxError is an old-style string
exception or new-fangled class exception.

PyErr_Print(): Many changes:

    1. Normalize the exception.

    2. Handle SystemExit exceptions which might be class based.  Digs
       the exit code out of the "code" attribute.  String based
       SystemExit is handled the same as before.

    3. Handle SyntaxError exceptions which might be class based.  Digs
       the various information bits out of the instance's attributes
       (see parse_syntax_error() for details).  String based
       SyntaxError still works too.

    4. Don't write the `:' after the exception if the exception is
       class based and has an empty string str() value.
Python/pythonrun.c