Mercurial > cpython-lru_cache-weakref
diff Objects/typeobject.c @ 34668:9b3a2c4302aa 2.4
SF bug #1155938: Missing None check for __init__().
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Thu, 03 Mar 2005 16:55:53 +0000 |
| parents | 781aef974463 |
| children | 903045a70c3e c91e5e31c5ff |
line wrap: on
line diff
--- a/Objects/typeobject.c Thu Mar 03 12:26:20 2005 +0000 +++ b/Objects/typeobject.c Thu Mar 03 16:55:53 2005 +0000 @@ -4753,6 +4753,12 @@ 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; }
