summaryrefslogtreecommitdiff
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorMartin v. L?wis <martin@v.loewis.de>2012-05-15 14:34:58 +0200
committerMartin v. L?wis <martin@v.loewis.de>2012-05-15 14:34:58 +0200
commit91bfead43af07b97da7b36ac577bbde34eb5cd01 (patch)
treedbaa78b577b4622cd68f7acba134dcb90fd39fdd /Modules/itertoolsmodule.c
parentb6e49be0c3dbe48a6d66940f5ee270eae1fd87c6 (diff)
downloadcpython-91bfead43af07b97da7b36ac577bbde34eb5cd01.tar.gz
Add safecase to silence Win64 warning.
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 515f3bafb3..194f7fb5a3 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -533,7 +533,8 @@ teedataobject_new(PyTypeObject *type, PyObject *args, PyObject *kw)
tdo->values[i] = PyList_GET_ITEM(values, i);
Py_INCREF(tdo->values[i]);
}
- tdo->numread = len;
+ /* len <= LINKCELLS < INT_MAX */
+ tdo->numread = Py_SAFE_DOWNCAST(len, Py_ssize_t, int);
if (len == LINKCELLS) {
if (next != Py_None) {