Skip to content

Commit 4e6bf4b

Browse files
committed
merge
2 parents dc6a9c0 + b9db9e1 commit 4e6bf4b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Modules/_heapqmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ heappushpop(PyObject *self, PyObject *args)
235235
return item;
236236
}
237237

238+
if (PyList_GET_SIZE(heap) == 0) {
239+
PyErr_SetString(PyExc_IndexError, "index out of range");
240+
return NULL;
241+
}
242+
238243
returnitem = PyList_GET_ITEM(heap, 0);
239244
Py_INCREF(item);
240245
PyList_SET_ITEM(heap, 0, item);

0 commit comments

Comments
 (0)