From 5e68fc2a078997337ca62924cd3fd481d172e42b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 24 Nov 2019 16:26:22 +0000 Subject: [PATCH 1/1] key.c: Reformat the rest of the `KeyError' constructor. --- key.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/key.c b/key.c index d91651a..99c25ab 100644 --- a/key.c +++ b/key.c @@ -51,13 +51,12 @@ static PyObject *kxmeth___init__(PyObject *me, PyObject *arg) if (PyObject_SetAttrString(me, "err", x)) goto end; Py_DECREF(x); x = 0; - if ((x = PyString_FromString(key_strerror(err))) == 0 || - PyObject_SetAttrString(me, "errstring", x)) - goto end; + x = PyString_FromString(key_strerror(err)); if (!x) goto end; + if (PyObject_SetAttrString(me, "errstring", x)) goto end; Py_DECREF(x); x = 0; - if ((x = PyTuple_GetSlice(arg, 1, n)) == 0 || - PyObject_SetAttrString(me, "args", x)) - goto end; + + x = PyTuple_GetSlice(arg, 1, n); if (!x) goto end; + if (PyObject_SetAttrString(me, "args", x)) goto end; Py_DECREF(x); x = 0; RETURN_NONE; -- 2.11.0