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. --- Python/pylifecycle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/pylifecycle.c') diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 7cda44dc29d..ea89b3a626b 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1735,10 +1735,10 @@ create_stdio(const PyConfig *config, PyObject* io, mode = "wb"; else mode = "rb"; - buf = _PyObject_CallMethodId(io, &PyId_open, "isiOOOi", + buf = _PyObject_CallMethodId(io, &PyId_open, "isiOOOO", fd, mode, buffering, Py_None, Py_None, /* encoding, errors */ - Py_None, 0); /* newline, closefd */ + Py_None, Py_False); /* newline, closefd */ if (buf == NULL) goto error; -- cgit v1.2.3