diff Modules/itertoolsmodule.c @ 39868:eff88c6aaac3 2.5

backport of r51950 * regression bug, count_next was coercing a Py_ssize_t to an unsigned Py_size_t which breaks negative counts * added test for negative numbers
author Jack Diederich <jackdied@gmail.com>
date Thu, 21 Sep 2006 18:32:11 +0000
parents 9d44792063bb
children 77e0f4718a7c
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c	Thu Sep 21 18:12:15 2006 +0000
+++ b/Modules/itertoolsmodule.c	Thu Sep 21 18:32:11 2006 +0000
@@ -2072,7 +2072,7 @@
 static PyObject *
 count_next(countobject *lz)
 {
-	return PyInt_FromSize_t(lz->cnt++);
+	return PyInt_FromSsize_t(lz->cnt++);
 }
 
 static PyObject *