commit | 187e64806fca812453f6864b2bd6428c03c2c1a5 | [log] [tgz] |
---|---|---|
author | Jack Diederich <jackdied@gmail.com> | Thu Sep 21 18:32:11 2006 +0000 |
committer | Jack Diederich <jackdied@gmail.com> | Thu Sep 21 18:32:11 2006 +0000 |
tree | f14fbd3909d5e0097144ba6c1bae41e9df7dc0eb | |
parent | c70e003f75f40f0dcce1a7b7e02bebe16204c985 [diff] [blame] |
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
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 *