mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (#119216)
This commit is contained in:
parent
b64182550f
commit
6e9863d7a3
10 changed files with 60 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue