mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
- Fix a GC bug caused by PyDict_New() failing.
This commit is contained in:
parent
e3550a65eb
commit
5196c586bb
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue