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
8 changes: 8 additions & 0 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,10 @@ because the :ref:`call protocol <call>` takes care of recursion handling.
case, a :exc:`RecursionError` is set and a nonzero value is returned.
Otherwise, zero is returned.

The check is based on the remaining C stack space of the current thread,
not on a count of calls, so it is unaffected by
:c:func:`Py_SetRecursionLimit` and :func:`sys.setrecursionlimit`.

*where* should be a UTF-8 encoded string such as ``" in instance check"`` to
be concatenated to the :exc:`RecursionError` message caused by the recursion
depth limit.
Expand All @@ -1026,6 +1030,10 @@ because the :ref:`call protocol <call>` takes care of recursion handling.
.. versionchanged:: 3.9
This function is now also available in the :ref:`limited API <limited-c-api>`.

.. versionchanged:: 3.14
The check is based on the remaining C stack space. Previously, a
separate counter of C-level calls was used.

.. c:function:: void Py_LeaveRecursiveCall(void)

Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each
Expand Down
Loading