PyErr_PrintEx is also in 2.x...

This commit is contained in:
Georg Brandl 2009-02-05 11:23:47 +00:00
parent b21c75beab
commit 3ceebd2ca7
1 changed files with 10 additions and 1 deletions

View File

@ -41,12 +41,21 @@ is a separate error indicator for each thread.
Either alphabetical or some kind of structure. Either alphabetical or some kind of structure.
.. cfunction:: void PyErr_Print() .. cfunction:: void PyErr_PrintEx(int set_sys_last_vars)
Print a standard traceback to ``sys.stderr`` and clear the error indicator. Print a standard traceback to ``sys.stderr`` and clear the error indicator.
Call this function only when the error indicator is set. (Otherwise it will Call this function only when the error indicator is set. (Otherwise it will
cause a fatal error!) cause a fatal error!)
If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`,
:data:`sys.last_value` and :data:`sys.last_traceback` will be set to the
type, value and traceback of the printed exception, respectively.
.. cfunction:: void PyErr_Print()
Alias for ``PyErr_PrintEx(1)``.
.. cfunction:: PyObject* PyErr_Occurred() .. cfunction:: PyObject* PyErr_Occurred()