summaryrefslogtreecommitdiffstats
path: root/Doc/ext/noddy2.c
diff options
context:
space:
mode:
authorJim Fulton <jim@zope.com>2003-06-28 11:54:03 (GMT)
committerJim Fulton <jim@zope.com>2003-06-28 11:54:03 (GMT)
commit7050e929e62d812e1e41ed1bc3a9d63cd9650e88 (patch)
treef96299543a57c714400a0299bccbcf48be005a43 /Doc/ext/noddy2.c
parent4b59f9165de726c6850357fc3e1d19f590e98102 (diff)
downloadcpython-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/noddy2.c')
-rw-r--r--Doc/ext/noddy2.c7
1 files changed, 3 insertions, 4 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;
}