From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 9 Nov 2025 17:20:18 +0000 (+0100) Subject: [3.13] gh-141004: Document `PyExceptionInstance*` APIs (GH-141301) (GH-141303) X-Git-Tag: v3.13.10~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9619899fc8b5c013e54a671687e4bbc9e8bbb39;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-141004: Document `PyExceptionInstance*` APIs (GH-141301) (GH-141303) gh-141004: Document `PyExceptionInstance*` APIs (GH-141301) (cherry picked from commit b5a0c72492800c7e999b87adfcfeabaacb4ecb97) Co-authored-by: Peter Bierma Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index c889d812a97b..0b5c3776b16a 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -788,6 +788,17 @@ Exception Classes Exception Objects ================= +.. c:function:: int PyExceptionInstance_Check(PyObject *op) + + Return true if *op* is an instance of :class:`BaseException`, false + otherwise. This function always succeeds. + + +.. c:macro:: PyExceptionInstance_Class(op) + + Equivalent to :c:func:`Py_TYPE(op) `. + + .. c:function:: PyObject* PyException_GetTraceback(PyObject *ex) Return the traceback associated with the exception as a new reference, as