summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-10-30 17:01:03 (GMT)
committerGitHub <noreply@github.com>2023-10-30 17:01:03 (GMT)
commitbca330542912532baa33af20a107fcf956cf007a (patch)
tree292619dafebc1a7e766241ea712019cbc0bc761c /Doc
parent8eaa206feccc913d172027a613d34a50210f4511 (diff)
downloadcpython-bca330542912532baa33af20a107fcf956cf007a.zip
cpython-bca330542912532baa33af20a107fcf956cf007a.tar.gz
cpython-bca330542912532baa33af20a107fcf956cf007a.tar.bz2
gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455)
Also document the behavior when called with NULL.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/exceptions.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 2139da0..f27e2bb 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -88,9 +88,17 @@ Printing and clearing
The function is called with a single argument *obj* that identifies the context
in which the unraisable exception occurred. If possible,
the repr of *obj* will be printed in the warning message.
+ If *obj* is ``NULL``, only the traceback is printed.
An exception must be set when calling this function.
+ .. versionchanged:: 3.4
+ Print a traceback. Print only traceback if *obj* is ``NULL``.
+
+ .. versionchanged:: 3.8
+ Use :func:`sys.unraisablehook`.
+
+
.. c:function:: void PyErr_DisplayException(PyObject *exc)
Print the standard traceback display of ``exc`` to ``sys.stderr``, including