From 2ba86c6a2a888fb4d3a365a133ed39b3d528e7a6 Mon Sep 17 00:00:00 2001 From: Stefan Behnel <stefan_ml@behnel.de> Date: Thu, 21 Dec 2017 08:03:49 +0100 Subject: [PATCH] Simplify error handling in short helper function. --- Cython/Utility/ObjectHandling.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Cython/Utility/ObjectHandling.c b/Cython/Utility/ObjectHandling.c index 1b8a69bb1..cecb2cc83 100644 --- a/Cython/Utility/ObjectHandling.c +++ b/Cython/Utility/ObjectHandling.c @@ -1485,12 +1485,11 @@ done: } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { - PyObject *method, *result = NULL; + PyObject *method, *result; method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto done; + if (unlikely(!method)) return NULL; result = __Pyx__PyObject_CallMethod1(method, arg); -done: - Py_XDECREF(method); + Py_DECREF(method); return result; } -- 2.30.9