[Python-checkins] python/dist/src/Modules heapqmodule.c,1.1,1.2

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sat Nov 15 07:33:04 EST 2003


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv18706

Modified Files:
	heapqmodule.c 
Log Message:
Verify heappop argument is a list.

Index: heapqmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/heapqmodule.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** heapqmodule.c	8 Nov 2003 10:24:38 -0000	1.1
--- heapqmodule.c	15 Nov 2003 12:33:01 -0000	1.2
***************
*** 120,123 ****
--- 120,128 ----
  	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);





More information about the Python-checkins mailing list