[Python-checkins] python/dist/src/Modules heapqmodule.c,1.2,1.3
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Sat Nov 15 07:40:30 EST 2003
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv19689
Modified Files:
heapqmodule.c
Log Message:
Change ValueErrors to TypeErrors and add PyList_Check() assertions.
Index: heapqmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/heapqmodule.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** heapqmodule.c 15 Nov 2003 12:33:01 -0000 1.2
--- heapqmodule.c 15 Nov 2003 12:40:28 -0000 1.3
***************
*** 15,18 ****
--- 15,19 ----
int cmp, parentpos;
+ assert(PyList_Check(heap));
if (pos >= PyList_GET_SIZE(heap)) {
PyErr_SetString(PyExc_IndexError, "index out of range");
***************
*** 49,52 ****
--- 50,54 ----
PyObject *newitem, *tmp;
+ assert(PyList_Check(heap));
endpos = PyList_GET_SIZE(heap);
startpos = pos;
***************
*** 98,102 ****
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_ValueError, "heap argument must be a list");
return NULL;
}
--- 100,104 ----
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_TypeError, "heap argument must be a list");
return NULL;
}
***************
*** 121,125 ****
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_ValueError, "heap argument must be a list");
return NULL;
}
--- 123,127 ----
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_TypeError, "heap argument must be a list");
return NULL;
}
***************
*** 160,164 ****
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_ValueError, "heap argument must be a list");
return NULL;
}
--- 162,166 ----
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_TypeError, "heap argument must be a list");
return NULL;
}
***************
*** 193,197 ****
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_ValueError, "heap argument must be a list");
return NULL;
}
--- 195,199 ----
if (!PyList_Check(heap)) {
! PyErr_SetString(PyExc_TypeError, "heap argument must be a list");
return NULL;
}
More information about the Python-checkins
mailing list