@@ -195,6 +195,10 @@ static PyObject* wrap_ssizeobjargproc(ssizeobjargproc f, PyObject* a, PyObject*
195
195
return PyLong_FromLong (f (explicit_cast (a ), PyLong_AsSsize_t (size ), explicit_cast (b )));
196
196
}
197
197
198
+ static PyObject * wrap_initproc (initproc f , PyObject * a , PyObject * b , PyObject * c ) {
199
+ return PyLong_FromLong (f (explicit_cast (a ), explicit_cast (b ), explicit_cast (c )));
200
+ }
201
+
198
202
int PyType_Ready (PyTypeObject * cls ) {
199
203
#define ADD_IF_MISSING (attr , def ) if (!(attr)) { attr = def; }
200
204
#define ADD_METHOD (m ) ADD_METHOD_OR_SLOT(m.ml_name, get_method_flags_cwrapper(m.ml_flags), m.ml_meth, m.ml_flags, m.ml_doc)
@@ -366,7 +370,7 @@ int PyType_Ready(PyTypeObject* cls) {
366
370
ADD_SLOT ("__next__" , cls -> tp_iternext , -1 );
367
371
ADD_SLOT ("__get__" , cls -> tp_descr_get , -3 );
368
372
ADD_SLOT ("__set__" , cls -> tp_descr_set , -3 );
369
- ADD_SLOT ("__init__" , cls -> tp_init , METH_KEYWORDS | METH_VARARGS );
373
+ ADD_SLOT_CONV ("__init__" , wrap_initproc , cls -> tp_init , METH_KEYWORDS | METH_VARARGS );
370
374
ADD_SLOT_CONV ("__alloc__" , wrap_allocfunc , cls -> tp_alloc , -2 );
371
375
ADD_SLOT ("__new__" , cls -> tp_new , METH_KEYWORDS | METH_VARARGS );
372
376
ADD_SLOT ("__free__" , cls -> tp_free , -1 );
0 commit comments