diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-03-25 19:16:13 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-03-25 19:16:13 (GMT) |
commit | ae605341e3eb9e6426db07660ac57675ae86e2b6 (patch) | |
tree | 8e753dc266bc1b3e5fb6d31538f1308e14f215af | |
parent | 4113b137cd9e02efe65d66ad2b671bbb9e5164dd (diff) | |
download | cpython-ae605341e3eb9e6426db07660ac57675ae86e2b6.zip cpython-ae605341e3eb9e6426db07660ac57675ae86e2b6.tar.gz cpython-ae605341e3eb9e6426db07660ac57675ae86e2b6.tar.bz2 |
Fixed ref count bug. Patch #411191. Found by Walter Dörwald.
-rw-r--r-- | Objects/object.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |