summaryrefslogtreecommitdiffstats
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-09-01 09:16:51 (GMT)
committerGitHub <noreply@github.com>2019-09-01 09:16:51 (GMT)
commit1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 (patch)
tree8db3de2421c1d45d018a7a1dc03f42a0797acee2 /Modules/itertoolsmodule.c
parent5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe (diff)
downloadcpython-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.zip
cpython-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.tar.gz
cpython-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.tar.bz2
bpo-15999: Clean up of handling boolean arguments. (GH-15610)
* Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index ab473e2..2e39842 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1059,10 +1059,10 @@ cycle_reduce(cycleobject *lz, PyObject *Py_UNUSED(ignored))
}
Py_DECREF(res);
}
- return Py_BuildValue("O(N)(Oi)", Py_TYPE(lz), it, lz->saved, 1);
+ return Py_BuildValue("O(N)(OO)", Py_TYPE(lz), it, lz->saved, Py_True);
}
- return Py_BuildValue("O(O)(Oi)", Py_TYPE(lz), lz->it, lz->saved,
- lz->firstpass);
+ return Py_BuildValue("O(O)(OO)", Py_TYPE(lz), lz->it, lz->saved,
+ lz->firstpass ? Py_True : Py_False);
}
static PyObject *