diff options
author | Raymond Hettinger <python@rcn.com> | 2005-03-03 16:45:19 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-03-03 16:45:19 (GMT) |
commit | b67cc80bb915680190eaf1c9feba8fe0799c83f8 (patch) | |
tree | 6646e6224775efdf1b4cba5a94479415d10e8019 /Objects | |
parent | 6ce7ed23d0449daa70f396486fae3c1014d93191 (diff) | |
download | cpython-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.c | 6 |
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; } |