[Python-checkins] python/dist/src/Objects object.c,2.220,2.221

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sat Aug 7 06:55:32 CEST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16012/Objects

Modified Files:
	object.c 
Log Message:
SF bug #1004669:  Type returned from .keys() is not checked



Index: object.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
retrieving revision 2.220
retrieving revision 2.221
diff -C2 -d -r2.220 -r2.221
*** object.c	8 Jul 2004 01:48:59 -0000	2.220
--- object.c	7 Aug 2004 04:55:30 -0000	2.221
***************
*** 1703,1706 ****
--- 1703,1711 ----
  
  	assert(result);
+ 	if (!PyList_Check(result)) {
+ 		PyErr_SetString(PyExc_TypeError, 
+ 			"Expected keys() to be a list.");
+ 		goto error;
+ 	}
  	if (PyList_Sort(result) != 0)
  		goto error;



More information about the Python-checkins mailing list