Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Mar 23, 2023
1 parent 349a5f9 commit b0852d7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1391,18 +1391,16 @@ always available.
its return value is not used, so it can simply return ``None``. Error in the profile
function will cause itself unset.

.. note::
The same tracing mechanism is used for :func:`!setprofile` as :func:`settrace`.
To trace calls with :func:`!setprofile` inside a tracing function
(e.g. in a debugger breakpoint), see :func:`call_tracing`.

Profile functions should have three arguments: *frame*, *event*, and
*arg*. *frame* is the current stack frame. *event* is a string: ``'call'``,
``'return'``, ``'c_call'``, ``'c_return'``, or ``'c_exception'``. *arg* depends
on the event type.

.. note::
The same tracing mechanism is used for :func:`!setprofile` as :func:`settrace`.
To trace calls with :func:`!setprofile` inside a tracing function (e.g. in a
debugger breakpoint) see :func:`call_tracing`.

.. audit-event:: sys.setprofile "" sys.setprofile

The events have the following meaning:

``'call'``
Expand All @@ -1424,6 +1422,9 @@ always available.
``'c_exception'``
A C function has raised an exception. *arg* is the C function object.

.. audit-event:: sys.setprofile "" sys.setprofile


.. function:: setrecursionlimit(limit)

Set the maximum depth of the Python interpreter stack to *limit*. This limit
Expand Down

0 comments on commit b0852d7

Please sign in to comment.