Skip to content

Commit 93ac352

Browse files
authored
gh-139276: Remove generator type check in _testcapimodule.c:raise_SIGINT_then_send_None (#139252)
* Remove generator type check in raise_SIGINT_then_send_None In the Cinder JIT we use a different type for generators, which breaks the test which uses this function. In general I believe the intent with generators is they have the right structure rather than type, so a failure to find the 'send()' method is arguably more correct if the wrong object is used. * Also stop using PyGenObject type
1 parent 68a1778 commit 93ac352

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/_testcapimodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,9 +1583,9 @@ getitem_with_error(PyObject *self, PyObject *args)
15831583
static PyObject *
15841584
raise_SIGINT_then_send_None(PyObject *self, PyObject *args)
15851585
{
1586-
PyGenObject *gen;
1586+
PyObject *gen;
15871587

1588-
if (!PyArg_ParseTuple(args, "O!", &PyGen_Type, &gen))
1588+
if (!PyArg_ParseTuple(args, "O", &gen))
15891589
return NULL;
15901590

15911591
/* This is used in a test to check what happens if a signal arrives just
@@ -1599,7 +1599,7 @@ raise_SIGINT_then_send_None(PyObject *self, PyObject *args)
15991599
because we check for signals before every bytecode operation.
16001600
*/
16011601
raise(SIGINT);
1602-
return PyObject_CallMethod((PyObject *)gen, "send", "O", Py_None);
1602+
return PyObject_CallMethod(gen, "send", "O", Py_None);
16031603
}
16041604

16051605

0 commit comments

Comments
 (0)