From 1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 1 Sep 2019 12:16:51 +0300 Subject: 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. --- Modules/_io/stringio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/_io/stringio.c') diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 3f7afad563..89b29bb8fb 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -714,9 +714,9 @@ _io_StringIO___init___impl(stringio *self, PyObject *value, } if (self->readuniversal) { - self->decoder = PyObject_CallFunction( + self->decoder = PyObject_CallFunctionObjArgs( (PyObject *)&PyIncrementalNewlineDecoder_Type, - "Oi", Py_None, (int) self->readtranslate); + Py_None, self->readtranslate ? Py_True : Py_False, NULL); if (self->decoder == NULL) return -1; } -- cgit v1.2.1