Commit a5883433 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

Document the surprising sideeffect PyErr_Print(). (GH-12081)


Did you know an API documented as printing the pending traceback would sometimes exit the process?

You do now.
(cherry picked from commit 41737720)
Co-authored-by: default avatarGregory P. Smith <greg@krypto.org>
parent 60ef9b05
......@@ -44,8 +44,12 @@ is a separate error indicator for each thread.
.. c:function:: void PyErr_PrintEx(int set_sys_last_vars)
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`,
:data:`sys.last_value` and :data:`sys.last_traceback` will be set to the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment