summaryrefslogtreecommitdiff
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-17 00:02:43 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-02-17 00:02:43 +0100
commit8841d05ab7c7847685b9b2582eae8102dfe805a4 (patch)
treec1625359853a42577a8e56e55447df4f33a4f03f /Modules/timemodule.c
parent4706938c2445fdc4cc6fb0ce59a105d020f59d89 (diff)
downloadcpython-8841d05ab7c7847685b9b2582eae8102dfe805a4.tar.gz
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.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 2 insertions, 2 deletions
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;