From: Jim Fulton Date: Sat, 28 Jun 2003 11:54:03 +0000 (+0000) Subject: Fixed bug in implementation of tp_init function. It should be an int X-Git-Tag: v2.3c1~289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7050e929e62d812e1e41ed1bc3a9d63cd9650e88;p=python Fixed bug in implementation of tp_init function. It should be an int function, not a PyObject *. --- diff --git a/Doc/ext/noddy2.c b/Doc/ext/noddy2.c index fcce2abd97..03fe2888f9 100644 --- a/Doc/ext/noddy2.c +++ b/Doc/ext/noddy2.c @@ -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; } diff --git a/Doc/ext/noddy3.c b/Doc/ext/noddy3.c index 08ac31ec6a..9984a3d0d1 100644 --- a/Doc/ext/noddy3.c +++ b/Doc/ext/noddy3.c @@ -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[] = {