diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 60c4fbc..2a7df8a 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -303,13 +303,16 @@ type_set_bases(PyTypeObject *type, PyObject *value, void *context) return r; bail: + Py_DECREF(type->tp_bases); + Py_DECREF(type->tp_base); + if (type->tp_mro != old_mro) { + Py_DECREF(type->tp_mro); + } + type->tp_bases = old_bases; type->tp_base = old_base; type->tp_mro = old_mro; - Py_DECREF(value); - Py_DECREF(new_base); - return -1; } |