diff Modules/itertoolsmodule.c @ 76946:d274fa027cf5

Add safecase to silence Win64 warning.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 15 May 2012 14:34:58 +0200
parents 4ff234337e24
children b878df1d23b1
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c	Tue May 15 14:06:21 2012 +0200
+++ b/Modules/itertoolsmodule.c	Tue May 15 14:34:58 2012 +0200
@@ -533,7 +533,8 @@
         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) {