From 8841d05ab7c7847685b9b2582eae8102dfe805a4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 17 Feb 2014 00:02:43 +0100 Subject: Issue #20320: select.select() and select.kqueue.control() now round the timeout aways from zero, instead of rounding towards zero. It should make test_asyncio more reliable, especially test_timeout_rounding() test. --- Modules/timemodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/timemodule.c') diff --git a/Modules/timemodule.c b/Modules/timemodule.c index d3878b95d9..44540ea919 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -193,7 +193,7 @@ time_clock_settime(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "iO:clock_settime", &clk_id, &obj)) return NULL; - if (_PyTime_ObjectToTimespec(obj, &tv_sec, &tv_nsec) == -1) + if (_PyTime_ObjectToTimespec(obj, &tv_sec, &tv_nsec, _PyTime_ROUND_DOWN) == -1) return NULL; tp.tv_sec = tv_sec; tp.tv_nsec = tv_nsec; @@ -341,7 +341,7 @@ parse_time_t_args(PyObject *args, char *format, time_t *pwhen) whent = time(NULL); } else { - if (_PyTime_ObjectToTime_t(ot, &whent) == -1) + if (_PyTime_ObjectToTime_t(ot, &whent, _PyTime_ROUND_DOWN) == -1) return 0; } *pwhen = whent; -- cgit v1.2.1