Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f88db8d

Browse files
committed
Issue 8420: Fix ref counting problem in set_repr().
1 parent 7276f13 commit f88db8d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Objects/setobject.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,8 @@ set_repr(PySetObject *so)
601601

602602
listrepr = PyObject_Repr(keys);
603603
Py_DECREF(keys);
604-
if (listrepr == NULL) {
605-
Py_DECREF(keys);
604+
if (listrepr == NULL)
606605
goto done;
607-
}
608606
newsize = PyUnicode_GET_SIZE(listrepr);
609607
result = PyUnicode_FromUnicode(NULL, newsize);
610608
if (result) {

0 commit comments

Comments
 (0)