summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 8fa115c..f7dac5b 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);
}