Browse Source
Document the surprising sideeffect PyErr_Print(). (#12081)
Did you know an API documented as printing the pending traceback would sometimes exit the process?
You do now.
pull/12093/head
Gregory P. Smith
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
2 deletions
-
Doc/c-api/exceptions.rst
|
|
@ -53,8 +53,12 @@ Printing and clearing |
|
|
.. c:function:: void PyErr_PrintEx(int set_sys_last_vars) |
|
|
.. c:function:: 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 |
|
|
|
|
|
cause a fatal error!) |
|
|
|
|
|
|
|
|
**Unless** the error is a ``SystemExit``. In that case the no traceback |
|
|
|
|
|
is printed and Python process will exit with the error code specified by |
|
|
|
|
|
the ``SystemExit`` instance. |
|
|
|
|
|
|
|
|
|
|
|
Call this function **only** when the error indicator is set. Otherwise it |
|
|
|
|
|
will cause a fatal error! |
|
|
|
|
|
|
|
|
If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, |
|
|
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 |
|
|
:data:`sys.last_value` and :data:`sys.last_traceback` will be set to the |
|
|
|