diff options
-rw-r--r-- | Objects/typeobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index f51700e..88cca93 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3130,8 +3130,10 @@ object_repr(PyObject *self) mod = NULL; } name = type_qualname(type, NULL); - if (name == NULL) + if (name == NULL) { + Py_XDECREF(mod); return NULL; + } if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins")) rtn = PyUnicode_FromFormat("<%U.%U object at %p>", mod, name, self); else |