Skip to content

Commit fb35241

Browse files
miss-islingtongpshead
authored andcommitted
Document the surprising sideeffect PyErr_Print(). (GH-12081) (GH-12084)
(cherry picked from commit 4173772) Co-authored-by: Gregory P. Smith <greg@krypto.org>
1 parent 1dee456 commit fb35241

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Doc/c-api/exceptions.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ Printing and clearing
5353
.. c:function:: void PyErr_PrintEx(int set_sys_last_vars)
5454
5555
Print a standard traceback to ``sys.stderr`` and clear the error indicator.
56-
Call this function only when the error indicator is set. (Otherwise it will
57-
cause a fatal error!)
56+
**Unless** the error is a ``SystemExit``. In that case the no traceback
57+
is printed and Python process will exit with the error code specified by
58+
the ``SystemExit`` instance.
59+
60+
Call this function **only** when the error indicator is set. Otherwise it
61+
will cause a fatal error!
5862
5963
If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`,
6064
:data:`sys.last_value` and :data:`sys.last_traceback` will be set to the

0 commit comments

Comments
 (0)