summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 5d625a2..9f0d13e 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2250,11 +2250,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
goto error;
}
}
- else {
- qualname = et->ht_name;
- }
- Py_INCREF(qualname);
- et->ht_qualname = qualname;
+ et->ht_qualname = qualname ? qualname : et->ht_name;
+ Py_INCREF(et->ht_qualname);
+ if (qualname != NULL && PyDict_DelItem(dict, PyId___qualname__.object) < 0)
+ goto error;
/* Set tp_doc to a copy of dict['__doc__'], if the latter is there
and is a string. The __doc__ accessor will first look for tp_doc;