mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
SF bug #1155938: Missing None check for __init__().
This commit is contained in:
parent
6ce7ed23d0
commit
b67cc80bb9
3 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue