bpo-41756: Add PyIter_Send function (#22443)

This commit is contained in:
Vladimir Matveev 2020-10-09 17:15:15 -07:00 committed by GitHub
parent 9975cc5008
commit 037245c5ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 78 additions and 42 deletions

View file

@ -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);
}