@@ -590,8 +590,9 @@ _gen_throw(PyGenObject *gen, int close_on_genexit,
590
590
591
591
592
592
static PyObject *
593
- gen_throw (PyGenObject * gen , PyObject * const * args , Py_ssize_t nargs )
593
+ gen_throw (PyObject * op , PyObject * const * args , Py_ssize_t nargs )
594
594
{
595
+ PyGenObject * gen = _PyGen_CAST (op );
595
596
PyObject * typ ;
596
597
PyObject * tb = NULL ;
597
598
PyObject * val = NULL ;
@@ -821,8 +822,9 @@ static PyMemberDef gen_memberlist[] = {
821
822
};
822
823
823
824
static PyObject *
824
- gen_sizeof (PyGenObject * gen , PyObject * Py_UNUSED (ignored ))
825
+ gen_sizeof (PyObject * op , PyObject * Py_UNUSED (ignored ))
825
826
{
827
+ PyGenObject * gen = _PyGen_CAST (op );
826
828
Py_ssize_t res ;
827
829
res = offsetof(PyGenObject , gi_iframe ) + offsetof(_PyInterpreterFrame , localsplus );
828
830
PyCodeObject * code = _PyGen_GetCode (gen );
@@ -837,7 +839,7 @@ static PyMethodDef gen_methods[] = {
837
839
{"send" , gen_send , METH_O , send_doc },
838
840
{"throw" , _PyCFunction_CAST (gen_throw ), METH_FASTCALL , throw_doc },
839
841
{"close" , gen_close , METH_NOARGS , close_doc },
840
- {"__sizeof__" , ( PyCFunction ) gen_sizeof , METH_NOARGS , sizeof__doc__ },
842
+ {"__sizeof__" , gen_sizeof , METH_NOARGS , sizeof__doc__ },
841
843
{"__class_getitem__" , Py_GenericAlias , METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
842
844
{NULL , NULL } /* Sentinel */
843
845
};
@@ -1197,7 +1199,7 @@ static PyMethodDef coro_methods[] = {
1197
1199
{"send" , gen_send , METH_O , coro_send_doc },
1198
1200
{"throw" ,_PyCFunction_CAST (gen_throw ), METH_FASTCALL , coro_throw_doc },
1199
1201
{"close" , gen_close , METH_NOARGS , coro_close_doc },
1200
- {"__sizeof__" , ( PyCFunction ) gen_sizeof , METH_NOARGS , sizeof__doc__ },
1202
+ {"__sizeof__" , gen_sizeof , METH_NOARGS , sizeof__doc__ },
1201
1203
{"__class_getitem__" , Py_GenericAlias , METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
1202
1204
{NULL , NULL } /* Sentinel */
1203
1205
};
@@ -1288,7 +1290,7 @@ static PyObject *
1288
1290
coro_wrapper_throw (PyObject * self , PyObject * const * args , Py_ssize_t nargs )
1289
1291
{
1290
1292
PyCoroWrapper * cw = _PyCoroWrapper_CAST (self );
1291
- return gen_throw ((PyGenObject * )cw -> cw_coroutine , args , nargs );
1293
+ return gen_throw ((PyObject * )cw -> cw_coroutine , args , nargs );
1292
1294
}
1293
1295
1294
1296
static PyObject *
@@ -1625,7 +1627,7 @@ static PyMethodDef async_gen_methods[] = {
1625
1627
{"asend" , (PyCFunction )async_gen_asend , METH_O , async_asend_doc },
1626
1628
{"athrow" ,(PyCFunction )async_gen_athrow , METH_VARARGS , async_athrow_doc },
1627
1629
{"aclose" , (PyCFunction )async_gen_aclose , METH_NOARGS , async_aclose_doc },
1628
- {"__sizeof__" , ( PyCFunction ) gen_sizeof , METH_NOARGS , sizeof__doc__ },
1630
+ {"__sizeof__" , gen_sizeof , METH_NOARGS , sizeof__doc__ },
1629
1631
{"__class_getitem__" , Py_GenericAlias ,
1630
1632
METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
1631
1633
{NULL , NULL } /* Sentinel */
@@ -1842,7 +1844,7 @@ async_gen_asend_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
1842
1844
o -> ags_gen -> ag_running_async = 1 ;
1843
1845
}
1844
1846
1845
- PyObject * result = gen_throw ((PyGenObject * )o -> ags_gen , args , nargs );
1847
+ PyObject * result = gen_throw ((PyObject * )o -> ags_gen , args , nargs );
1846
1848
result = async_gen_unwrap_value (o -> ags_gen , result );
1847
1849
1848
1850
if (result == NULL ) {
@@ -2249,7 +2251,7 @@ async_gen_athrow_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
2249
2251
o -> agt_gen -> ag_running_async = 1 ;
2250
2252
}
2251
2253
2252
- PyObject * retval = gen_throw ((PyGenObject * )o -> agt_gen , args , nargs );
2254
+ PyObject * retval = gen_throw ((PyObject * )o -> agt_gen , args , nargs );
2253
2255
if (o -> agt_args ) {
2254
2256
retval = async_gen_unwrap_value (o -> agt_gen , retval );
2255
2257
if (retval == NULL ) {
0 commit comments