diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-02-27 15:46:08 -0800 |
---|---|---|
committer | Ned Deily <nad@python.org> | 2019-02-27 18:46:08 -0500 |
commit | fb352413c1fac65823f274feeb369cd5ab1af2e4 (patch) | |
tree | 9394aa928e38bf165a0243c1720ccd8c923b55bb | |
parent | 1dee4565fae9ccb54719fa99d7944c148736083a (diff) | |
download | cpython-git-fb352413c1fac65823f274feeb369cd5ab1af2e4.tar.gz |
Document the surprising sideeffect PyErr_Print(). (GH-12081) (GH-12084)
(cherry picked from commit 4173772031747a9b249be4100b4aa9eda805ea23)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
-rw-r--r-- | Doc/c-api/exceptions.rst | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 2bc1bd876a..817469af0a 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -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 |