Kaydet (Commit) 253021dd authored tarafından Victor Stinner's avatar Victor Stinner

Issue #27366: Fix init_subclass()

Handle PyTuple_New(0) failure.
üst ea5e5990
...@@ -7018,6 +7018,11 @@ init_subclass(PyTypeObject *type, PyObject *kwds) ...@@ -7018,6 +7018,11 @@ init_subclass(PyTypeObject *type, PyObject *kwds)
return -1; return -1;
tuple = PyTuple_New(0); tuple = PyTuple_New(0);
if (tuple == NULL) {
Py_DECREF(func);
return 0;
}
tmp = PyObject_Call(func, tuple, kwds); tmp = PyObject_Call(func, tuple, kwds);
Py_DECREF(tuple); Py_DECREF(tuple);
Py_DECREF(func); Py_DECREF(func);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment