diff Modules/_tkinter.c @ 51189:4ab381aea658 legacy-trunk

make _tkinter._flatten check the result of PySequence_Size for errors #3880
author Benjamin Peterson <benjamin@python.org>
date Fri, 30 Jan 2009 02:24:39 +0000
parents cdd5fa05c14d
children 40ff83e02395
line wrap: on
line diff
--- a/Modules/_tkinter.c	Fri Jan 30 02:02:25 2009 +0000
+++ b/Modules/_tkinter.c	Fri Jan 30 02:24:39 2009 +0000
@@ -2908,7 +2908,9 @@
 		return NULL;
 
 	context.maxsize = PySequence_Size(item);
-	if (context.maxsize <= 0)
+	if (context.maxsize < 0)
+		return NULL;
+	if (context.maxsize == 0)
 		return PyTuple_New(0);
 	
 	context.tuple = PyTuple_New(context.maxsize);