summaryrefslogtreecommitdiff
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, 1 insertions, 7 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index e6e1ff400e..1d84db1d9d 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1063,14 +1063,8 @@ static PyObject*
floattime(void)
{
_PyTime_timeval t;
- double secs;
_PyTime_gettimeofday(&t);
- secs = (double)t.tv_sec + t.tv_usec*0.000001;
- if (secs == 0.0) {
- PyErr_SetFromErrno(PyExc_OSError);
- return NULL;
- }
- return PyFloat_FromDouble(secs);
+ return PyFloat_FromDouble((double)t.tv_sec + t.tv_usec * 1e-6);
}