diff options
author | Jack Diederich <jackdied@gmail.com> | 2006-09-21 17:50:26 (GMT) |
---|---|---|
committer | Jack Diederich <jackdied@gmail.com> | 2006-09-21 17:50:26 (GMT) |
commit | 36234e8f6632673ed13658798307ff487d7a7f6a (patch) | |
tree | 2007dc234dcffac649f77a41d6ea35fa2b503940 /Modules | |
parent | d14bf61d0528d040183ba9ae7f6b8b4e340818ef (diff) | |
download | cpython-36234e8f6632673ed13658798307ff487d7a7f6a.zip cpython-36234e8f6632673ed13658798307ff487d7a7f6a.tar.gz cpython-36234e8f6632673ed13658798307ff487d7a7f6a.tar.bz2 |
* 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
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/itertoolsmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) static PyObject * count_next(countobject *lz) { - return PyInt_FromSize_t(lz->cnt++); + return PyInt_FromSsize_t(lz->cnt++); } static PyObject * |