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.
This commit is contained in:
Victor Stinner 2014-02-17 00:02:43 +01:00
parent 23f628de4a
commit 3c1b379ebd
10 changed files with 179 additions and 62 deletions

View file

@ -799,7 +799,8 @@ signal_sigtimedwait(PyObject *self, PyObject *args)
&signals, &timeout))
return NULL;
if (_PyTime_ObjectToTimespec(timeout, &tv_sec, &tv_nsec) == -1)
if (_PyTime_ObjectToTimespec(timeout, &tv_sec, &tv_nsec,
_PyTime_ROUND_DOWN) == -1)
return NULL;
buf.tv_sec = tv_sec;
buf.tv_nsec = tv_nsec;