mirror of https://github.com/python/cpython
Issue 8420: Fix ref counting problem in set_repr().
This commit is contained in:
parent
79a9351b52
commit
b136a9c9d7
|
@ -601,10 +601,8 @@ set_repr(PySetObject *so)
|
||||||
|
|
||||||
listrepr = PyObject_Repr(keys);
|
listrepr = PyObject_Repr(keys);
|
||||||
Py_DECREF(keys);
|
Py_DECREF(keys);
|
||||||
if (listrepr == NULL) {
|
if (listrepr == NULL)
|
||||||
Py_DECREF(keys);
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
|
||||||
newsize = PyUnicode_GET_SIZE(listrepr);
|
newsize = PyUnicode_GET_SIZE(listrepr);
|
||||||
result = PyUnicode_FromUnicode(NULL, newsize);
|
result = PyUnicode_FromUnicode(NULL, newsize);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
Loading…
Reference in New Issue