diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-24 10:18:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-24 10:18:13 (GMT) |
commit | c864efba25465eb6a4fff7e0a6df80a9ba449370 (patch) | |
tree | d4c9968b1ac36ac938a4b595d55534ea7f2ac5ea /Doc | |
parent | e27e36922ee9fa970d3d8e602ac7eeb442ca530a (diff) | |
download | cpython-c864efba25465eb6a4fff7e0a6df80a9ba449370.zip cpython-c864efba25465eb6a4fff7e0a6df80a9ba449370.tar.gz cpython-c864efba25465eb6a4fff7e0a6df80a9ba449370.tar.bz2 |
[3.13] gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216) (#119497)
* gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216)
(cherry picked from commit 6e9863d7a3516cc76d6ce13923b15620499f3855)
---------
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/monitoring.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/monitoring.rst b/Doc/c-api/monitoring.rst index 763ec8e..ec743b9 100644 --- a/Doc/c-api/monitoring.rst +++ b/Doc/c-api/monitoring.rst @@ -121,10 +121,10 @@ See :mod:`sys.monitoring` for descriptions of the events. :c:func:`PyErr_GetRaisedException`). -.. c:function:: int PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +.. c:function:: int PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, PyObject *value) - Fire a ``STOP_ITERATION`` event with the current exception (as returned by - :c:func:`PyErr_GetRaisedException`). + Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:`StopIteration`, it is used. Otherwise, + a new :exc:`StopIteration` instance is created with ``value`` as its argument. Managing the Monitoring State |