commit | 36234e8f6632673ed13658798307ff487d7a7f6a | [log] [tgz] |
---|---|---|
author | Jack Diederich <jackdied@gmail.com> | Thu Sep 21 17:50:26 2006 +0000 |
committer | Jack Diederich <jackdied@gmail.com> | Thu Sep 21 17:50:26 2006 +0000 |
tree | 2007dc234dcffac649f77a41d6ea35fa2b503940 | |
parent | d14bf61d0528d040183ba9ae7f6b8b4e340818ef [diff] [blame] |
* 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 will backport to 2.5.1
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index a41f55b..7fcbb10 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c
@@ -2072,7 +2072,7 @@ static PyObject * count_next(countobject *lz) { - return PyInt_FromSize_t(lz->cnt++); + return PyInt_FromSsize_t(lz->cnt++); } static PyObject *