mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
gh-108082: Add PyErr_FormatUnraisable() function (GH-111086)
This commit is contained in:
parent
453e96e302
commit
f6a02327b5
7 changed files with 142 additions and 8 deletions
|
|
@ -99,6 +99,18 @@ Printing and clearing
|
|||
Use :func:`sys.unraisablehook`.
|
||||
|
||||
|
||||
.. c:function:: void PyErr_FormatUnraisable(const char *format, ...)
|
||||
|
||||
Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent
|
||||
parameters help format the warning message; they have the same meaning and
|
||||
values as in :c:func:`PyUnicode_FromFormat`.
|
||||
``PyErr_WriteUnraisable(obj)`` is roughtly equivalent to
|
||||
``PyErr_FormatUnraisable("Exception ignored in: %R, obj)``.
|
||||
If *format* is ``NULL``, only the traceback is printed.
|
||||
|
||||
.. versionadded:: 3.13
|
||||
|
||||
|
||||
.. c:function:: void PyErr_DisplayException(PyObject *exc)
|
||||
|
||||
Print the standard traceback display of ``exc`` to ``sys.stderr``, including
|
||||
|
|
@ -106,6 +118,7 @@ Printing and clearing
|
|||
|
||||
.. versionadded:: 3.12
|
||||
|
||||
|
||||
Raising exceptions
|
||||
==================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue