Fixed bug in implementation of tp_init function. It should be an int

function, not a PyObject *.
This commit is contained in:
Jim Fulton 2003-06-28 11:54:03 +00:00
parent 4b59f9165d
commit 7050e929e6
2 changed files with 6 additions and 8 deletions

View File

@ -43,7 +43,7 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return (PyObject *)self;
}
static PyObject *
static int
Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
{
PyObject *first=NULL, *last=NULL;
@ -53,7 +53,7 @@ Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
if (! PyArg_ParseTupleAndKeywords(args, kwds, "|OOi", kwlist,
&first, &last,
&self->number))
return NULL;
return -1;
if (first) {
Py_XDECREF(self->first);
@ -67,8 +67,7 @@ Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
self->last = last;
}
Py_INCREF(Py_None);
return Py_None;
return 0;
}

View File

@ -43,7 +43,7 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return (PyObject *)self;
}
static PyObject *
static int
Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
{
PyObject *first=NULL, *last=NULL;
@ -53,7 +53,7 @@ Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
if (! PyArg_ParseTupleAndKeywords(args, kwds, "|OOi", kwlist,
&first, &last,
&self->number))
return NULL;
return -1;
if (first) {
Py_DECREF(self->first);
@ -67,8 +67,7 @@ Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
self->last = last;
}
Py_INCREF(Py_None);
return Py_None;
return 0;
}
static PyMemberDef Noddy_members[] = {