summaryrefslogtreecommitdiff
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-07 18:30:48 +0000
committerKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-07 18:30:48 +0000
commitf4601d874fc41cc7aa904ff09b9da273cefd7b72 (patch)
tree6e1177203fc3b8c4d204afcb2a52ccaca6430e66 /Modules/itertoolsmodule.c
parentb4c285a25b78296afbc1a26f7ac14a41d011a48c (diff)
downloadcpython-git-f4601d874fc41cc7aa904ff09b9da273cefd7b72.tar.gz
Fix two problems that emerged when the testsuite was run with an x64 build: PyLong_FromSSize_t incorrectly assumed an unsigned object, and itertools.count() had the wrong upper limit for the iterator.
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 70f787f784..31f20c710c 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -2073,9 +2073,9 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static PyObject *
count_next(countobject *lz)
{
- if (lz->cnt == LONG_MAX) {
+ if (lz->cnt == PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
- "cannot count beyond LONG_MAX");
+ "cannot count beyond PY_SSIZE_T_MAX");
return NULL;
}
return PyInt_FromSsize_t(lz->cnt++);