FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-141004: Document `PyTraceBack*` APIs (GH-141192) by miss-islington · Pull Request #141211 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
34 changes: 34 additions & 0 deletions Doc/c-api/exceptions.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL