commit | 236a2443fbe32577bc4b5b9a1b58aa93f9d91de0 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Sat Nov 15 12:33:01 2003 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Sat Nov 15 12:33:01 2003 +0000 |
tree | 3776441d4fb5922abfba520007653c965a302c40 | |
parent | cf0005baf40bffc503e062b3520a312a5f2cfd2b [diff] [blame] |
Verify heappop argument is a list.
diff --git a/Modules/heapqmodule.c b/Modules/heapqmodule.c index 8a6a4f5..629f516 100644 --- a/Modules/heapqmodule.c +++ b/Modules/heapqmodule.c
@@ -119,6 +119,11 @@ 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) {