From 3e38af6592ff9d1662de5d6fdb9d7cf4e17d643b Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 9 Nov 2025 12:09:09 -0500 Subject: [PATCH] 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> --- Doc/c-api/exceptions.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index c58aa659e1b1b4..5241533e11281f 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