diff --git a/Objects/object.c b/Objects/object.c index e1dd470569b..47907bcb1d7 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -346,8 +346,10 @@ PyObject_Unicode(PyObject *v) Py_INCREF(v); return v; } - else if (PyString_Check(v)) + else if (PyString_Check(v)) { + Py_INCREF(v); res = v; + } else if (v->ob_type->tp_str != NULL) res = (*v->ob_type->tp_str)(v); else {