]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document the surprising sideeffect PyErr_Print(). (GH-12081) (GH-12084) 12121/head 12122/head
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 27 Feb 2019 23:46:08 +0000 (15:46 -0800)
committerNed Deily <nad@python.org>
Wed, 27 Feb 2019 23:46:08 +0000 (18:46 -0500)
(cherry picked from commit 4173772031747a9b249be4100b4aa9eda805ea23)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Doc/c-api/exceptions.rst

index 2bc1bd876a2fe271086ebcd97daa9001794c2fd9..817469af0a582bec76381929e6dec9303cf99a0e 100644 (file)
@@ -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