From 33cac8578bede2e9d6688ff46e849df7c2897a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 15 May 2012 14:34:58 +0200 Subject: Add safecase to silence Win64 warning. --- Modules/itertoolsmodule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 515f3ba..194f7fb 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) { -- cgit v0.12