Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-101100: Clean up Doc/c-api/exceptions.rst and Doc/c-api/sys.rst #114825

Merged
merged 11 commits into from
Feb 11, 2024
Prev Previous commit
Next Next commit
maybe this is better
  • Loading branch information
smontanaro committed Feb 9, 2024
commit bf7297c7d149cfa32a3e890db8024b2fad0d3aac
20 changes: 11 additions & 9 deletions Doc/c-api/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,15 @@ accessible to C code. They all work with the current interpreter thread's
.. versionadded:: 3.13


.. c:namespace:: NULL
.. c:type:: int (*Py_AuditHookFunction) (const char *event, PyObject *args, void *userData)

The type of the hook function.
*event* is the C string event argument passed to :c:func:`PySys_Audit` or
:c:func:`PySys_AuditTuple`.
*args* is guaranteed to be a :c:type:`PyTupleObject`.
*userData* is the argument passed to PySys_AddAuditHook().

.. c:function:: int PySys_AddAuditHook(Py_AuditHookFunction hook, void *userData)

Append the callable *hook* to the list of active auditing hooks.
Expand All @@ -346,15 +355,8 @@ accessible to C code. They all work with the current interpreter thread's
silently abort the operation by raising an error subclassed from
:class:`Exception` (other errors will not be silenced).

.. c:namespace:: NULL
.. c:type:: int (*Py_AuditHookFunction) (const char *event, PyObject *args, void *userData)

The type of the hook function.
*event* is (the event argument passed to PySys_Audit() or PySys_AuditTuple()),
*args* is guaranteed to be a :c:type:`PyTupleObject`. The hook
function is always called with the GIL held by the Python
interpreter that raised the event.
*userData* is the argument passed to PySys_AddAuditHook().
The hook function is always called with the GIL held by the Python
interpreter that raised the event.

See :pep:`578` for a detailed description of auditing. Functions in the
runtime and standard library that raise events are listed in the
Expand Down
Loading