Commit f5d615af authored by Raymond Hettinger's avatar Raymond Hettinger

Verify heappop argument is a list.

parent 45d9ebb5
......@@ -119,6 +119,11 @@ heappop(PyObject *self, PyObject *heap)
PyObject *lastelt, *returnitem;
int n;
if (!PyList_Check(heap)) {
PyErr_SetString(PyExc_ValueError, "heap argument must be a list");
return NULL;
}
/* # raises appropriate IndexError if heap is empty */
n = PyList_GET_SIZE(heap);
if (n == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment