summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-03-03 16:55:53 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-03-03 16:55:53 (GMT)
commit2a06df625837867f8595de7bd334f401f6ab2a85 (patch)
treef6689d29705a89337f22a1dbf3d524d8a981d413 /Objects
parent77c8402c97092b5520ac13ad4ffa4417a08a8db9 (diff)
downloadcpython-2a06df625837867f8595de7bd334f401f6ab2a85.zip
cpython-2a06df625837867f8595de7bd334f401f6ab2a85.tar.gz
cpython-2a06df625837867f8595de7bd334f401f6ab2a85.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;
}