mirror of https://github.com/python/cpython.git
- Fix a GC bug caused by PyDict_New() failing.
This commit is contained in:
parent
e3550a65eb
commit
5196c586bb
|
@ -2875,7 +2875,8 @@ Instance_New(PyObject *cls, PyObject *args) {
|
|||
inst->in_class=(PyClassObject*)cls;
|
||||
Py_INCREF(cls);
|
||||
UNLESS (inst->in_dict=PyDict_New()) {
|
||||
Py_DECREF(inst);
|
||||
inst = (PyInstanceObject *) PyObject_AS_GC(inst);
|
||||
PyObject_DEL(inst);
|
||||
goto err;
|
||||
}
|
||||
PyObject_GC_Init(inst);
|
||||
|
|
Loading…
Reference in New Issue