mirror of https://github.com/python/cpython
Fixed ref count bug. Patch #411191. Found by Walter Dörwald.
This commit is contained in:
parent
4113b137cd
commit
ae605341e3
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue