Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9e4a41 commit 89a6e9aCopy full SHA for 89a6e9a
1 file changed
Objects/typeobject.c
@@ -3527,6 +3527,7 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
3527
3528
for (; meth->ml_name != NULL; meth++) {
3529
PyObject *descr;
3530
+ int err;
3531
if (PyDict_GetItemString(dict, meth->ml_name) &&
3532
!(meth->ml_flags & METH_COEXIST))
3533
continue;
@@ -3550,9 +3551,10 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
3550
3551
}
3552
if (descr == NULL)
3553
return -1;
- if (PyDict_SetItemString(dict, meth->ml_name, descr) < 0)
3554
- return -1;
+ err = PyDict_SetItemString(dict, meth->ml_name, descr);
3555
Py_DECREF(descr);
3556
+ if (err < 0)
3557
+ return -1;
3558
3559
return 0;
3560
0 commit comments