summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/typeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index b33b21c..6f5323e 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3143,8 +3143,10 @@ PyType_Ready(PyTypeObject *type)
/* Initialize tp_base (defaults to BaseObject unless that's us) */
base = type->tp_base;
- if (base == NULL && type != &PyBaseObject_Type)
+ if (base == NULL && type != &PyBaseObject_Type) {
base = type->tp_base = &PyBaseObject_Type;
+ Py_INCREF(base);
+ }
/* Initialize the base class */
if (base && base->tp_dict == NULL) {