diff options
Diffstat (limited to 'Modules/_collectionsmodule.c')
-rw-r--r-- | Modules/_collectionsmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index efce5ce..dc18e7e 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1403,8 +1403,10 @@ defdict_repr(defdictobject *dd) { int status = Py_ReprEnter(dd->default_factory); if (status != 0) { - if (status < 0) + if (status < 0) { + Py_DECREF(baserepr); return NULL; + } defrepr = PyUnicode_FromString("..."); } else |