Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mypyc/lib-rt/dict_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ tuple_T4CIOO CPyDict_NextItem(PyObject *dict_or_iter, CPyTagged offset) {
if (item == NULL || !PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
if (item != NULL) {
PyErr_SetString(PyExc_TypeError, "a tuple of length 2 expected");
Py_DECREF(item);
}
ret.f0 = 0;
ret.f2 = Py_None;
Expand All @@ -415,7 +416,10 @@ tuple_T4CIOO CPyDict_NextItem(PyObject *dict_or_iter, CPyTagged offset) {
ret.f0 = 1;
ret.f2 = PyTuple_GET_ITEM(item, 0);
ret.f3 = PyTuple_GET_ITEM(item, 1);
Py_INCREF(ret.f2);
Py_INCREF(ret.f3);
Py_DECREF(item);
return ret;
}
}
// PyDict_Next() returns borrowed references.
Expand Down
Loading