diff options
author | Jim Fulton <jim@zope.com> | 2003-06-28 11:54:03 (GMT) |
---|---|---|
committer | Jim Fulton <jim@zope.com> | 2003-06-28 11:54:03 (GMT) |
commit | 7050e929e62d812e1e41ed1bc3a9d63cd9650e88 (patch) | |
tree | f96299543a57c714400a0299bccbcf48be005a43 /Doc/ext | |
parent | 4b59f9165de726c6850357fc3e1d19f590e98102 (diff) | |
download | cpython-7050e929e62d812e1e41ed1bc3a9d63cd9650e88.zip cpython-7050e929e62d812e1e41ed1bc3a9d63cd9650e88.tar.gz cpython-7050e929e62d812e1e41ed1bc3a9d63cd9650e88.tar.bz2 |
Fixed bug in implementation of tp_init function. It should be an int
function, not a PyObject *.
Diffstat (limited to 'Doc/ext')
-rw-r--r-- | Doc/ext/noddy2.c | 7 | ||||
-rw-r--r-- | Doc/ext/noddy3.c | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/Doc/ext/noddy2.c b/Doc/ext/noddy2.c index fcce2ab..03fe288 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 08ac31e..9984a3d 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[] = { |