mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
bpo-41756: Add PyIter_Send function (#22443)
This commit is contained in:
parent
9975cc5008
commit
037245c5ac
12 changed files with 78 additions and 42 deletions
|
|
@ -5028,6 +5028,7 @@ dict_get_version(PyObject *self, PyObject *args)
|
|||
static PyObject *
|
||||
raise_SIGINT_then_send_None(PyObject *self, PyObject *args)
|
||||
{
|
||||
_Py_IDENTIFIER(send);
|
||||
PyGenObject *gen;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!", &PyGen_Type, &gen))
|
||||
|
|
@ -5044,7 +5045,7 @@ raise_SIGINT_then_send_None(PyObject *self, PyObject *args)
|
|||
because we check for signals before every bytecode operation.
|
||||
*/
|
||||
raise(SIGINT);
|
||||
return _PyGen_Send(gen, Py_None);
|
||||
return _PyObject_CallMethodIdOneArg((PyObject *)gen, &PyId_send, Py_None);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue