Skip to content

Commit

Permalink
Document the surprising sideeffect PyErr_Print(). (GH-12081) (GH-12084)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4173772)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
  • Loading branch information
2 people authored and ned-deily committed Feb 27, 2019
1 parent 1dee456 commit fb35241
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Doc/c-api/exceptions.rst
Expand Up @@ -53,8 +53,12 @@ Printing and clearing
.. 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
Expand Down

0 comments on commit fb35241

Please sign in to comment.