diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index e53c35347e4..d95376a581d 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -2055,7 +2055,7 @@ ifilter_next(ifilterobject *lz) if (item == NULL) return NULL; - if (lz->func == Py_None || lz->func == PyBool_Type) { + if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) { ok = PyObject_IsTrue(item); } else { PyObject *good; @@ -2199,7 +2199,7 @@ ifilterfalse_next(ifilterfalseobject *lz) if (item == NULL) return NULL; - if (lz->func == Py_None || lz->func == PyBool_Type) { + if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) { ok = PyObject_IsTrue(item); } else { PyObject *good;