From ae605341e3eb9e6426db07660ac57675ae86e2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Sun, 25 Mar 2001 19:16:13 +0000 Subject: =?UTF-8?q?Fixed=20ref=20count=20bug.=20Patch=20#411191.=20Found?= =?UTF-8?q?=20by=20Walter=20D=C3=B6rwald.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Objects/object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/object.c b/Objects/object.c index e1dd470..47907bc 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 { -- cgit v0.12