Fix error handling in timemodule.c
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 89a41ce..46b8e9a 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -128,8 +128,10 @@
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 @@
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);
}