summaryrefslogtreecommitdiffstats
path: root/Modules/_threadmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 72df78f..99611ee 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -1363,9 +1363,11 @@ PyInit__thread(void)
if (m == NULL)
return NULL;
- timeout_max = PY_TIMEOUT_MAX / 1000000;
- time_max = floor(_PyTime_AsSecondsDouble(_PyTime_MAX));
+ timeout_max = (double)PY_TIMEOUT_MAX * 1e-6;
+ time_max = _PyTime_AsSecondsDouble(_PyTime_MAX);
timeout_max = Py_MIN(timeout_max, time_max);
+ /* Round towards minus infinity */
+ timeout_max = floor(timeout_max);
v = PyFloat_FromDouble(timeout_max);
if (!v)