summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-03-03 16:45:19 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-03-03 16:45:19 (GMT)
commitb67cc80bb915680190eaf1c9feba8fe0799c83f8 (patch)
tree6646e6224775efdf1b4cba5a94479415d10e8019 /Objects
parent6ce7ed23d0449daa70f396486fae3c1014d93191 (diff)
downloadcpython-b67cc80bb915680190eaf1c9feba8fe0799c83f8.zip
cpython-b67cc80bb915680190eaf1c9feba8fe0799c83f8.tar.gz
cpython-b67cc80bb915680190eaf1c9feba8fe0799c83f8.tar.bz2
SF bug #1155938: Missing None check for __init__().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 600dca5..6c31c73 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4753,6 +4753,12 @@ slot_tp_init(PyObject *self, PyObject *args, PyObject *kwds)
Py_DECREF(meth);
if (res == NULL)
return -1;
+ if (res != Py_None) {
+ PyErr_SetString(PyExc_TypeError,
+ "__init__() should return None");
+ Py_DECREF(res);
+ return -1;
+ }
Py_DECREF(res);
return 0;
}