Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1225,3 +1225,37 @@ Warning types

.. versionadded:: 3.10
:c:data:`PyExc_EncodingWarning`.


Tracebacks
==========

.. c:var:: PyTypeObject PyTraceBack_Type

Type object for traceback objects. This is available as
:class:`types.TracebackType` in the Python layer.


.. c:function:: int PyTraceBack_Check(PyObject *op)

Return true if *op* is a traceback object, false otherwise. This function
does not account for subtypes.


.. c:function:: int PyTraceBack_Here(PyFrameObject *f)

Replace the :attr:`~BaseException.__traceback__` attribute on the current
exception with a new traceback prepending *f* to the existing chain.

Calling this function without an exception set is undefined behavior.

This function returns ``0`` on success, and returns ``-1`` with an
exception set on failure.


.. c:function:: int PyTraceBack_Print(PyObject *tb, PyObject *f)

Write the traceback *tb* into the file *f*.

This function returns ``0`` on success, and returns ``-1`` with an
exception set on failure.
Loading