There was an error while loading. Please reload this page.
1 parent 1af2bf7 commit b9db9e1Copy full SHA for b9db9e1
1 file changed
Modules/_heapqmodule.c
@@ -224,6 +224,11 @@ heappushpop(PyObject *self, PyObject *args)
224
return item;
225
}
226
227
+ if (PyList_GET_SIZE(heap) == 0) {
228
+ PyErr_SetString(PyExc_IndexError, "index out of range");
229
+ return NULL;
230
+ }
231
+
232
returnitem = PyList_GET_ITEM(heap, 0);
233
Py_INCREF(item);
234
PyList_SET_ITEM(heap, 0, item);
0 commit comments