From: Antoine Pitrou Date: Wed, 18 Jan 2012 00:41:44 +0000 (+0100) Subject: Fix error handling in timemodule.c X-Git-Tag: v3.3.0a1~365 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c085604b761e56ea6635ca6158356c9d46fea50;p=thirdparty%2FPython%2Fcpython.git Fix error handling in timemodule.c --- diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 89a41ceb0f63..46b8e9adff0d 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -128,8 +128,10 @@ time_clock_gettime(PyObject *self, PyObject *args) return NULL; ret = clock_gettime((clockid_t)clk_id, &tp); - if (ret != 0) + if (ret != 0) { PyErr_SetFromErrno(PyExc_IOError); + return NULL; + } return PyFloat_FromDouble(tp.tv_sec + tp.tv_nsec * 1e-9); } @@ -152,8 +154,10 @@ time_clock_getres(PyObject *self, PyObject *args) return NULL; ret = clock_getres((clockid_t)clk_id, &tp); - if (ret != 0) + if (ret != 0) { PyErr_SetFromErrno(PyExc_IOError); + return NULL; + } return PyFloat_FromDouble(tp.tv_sec + tp.tv_nsec * 1e-9); }