Fixed ref count bug. Patch #411191. Found by Walter Dörwald.

This commit is contained in:
Marc-André Lemburg 2001-03-25 19:16:13 +00:00
parent 4113b137cd
commit ae605341e3
1 changed files with 3 additions and 1 deletions

View File

@ -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 {