mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
merge
This commit is contained in:
@@ -235,6 +235,11 @@ heappushpop(PyObject *self, PyObject *args)
|
||||
return item;
|
||||
}
|
||||
|
||||
if (PyList_GET_SIZE(heap) == 0) {
|
||||
PyErr_SetString(PyExc_IndexError, "index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
returnitem = PyList_GET_ITEM(heap, 0);
|
||||
Py_INCREF(item);
|
||||
PyList_SET_ITEM(heap, 0, item);
|
||||
|
||||
Reference in New Issue
Block a user