diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 01:49:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 01:49:14 (GMT) |
commit | 869e1778c0bcfc0928701c6ae0703934359d036b (patch) | |
tree | 231b2e09d453cca2ce5bf462ffb91f0f7303f3c0 /Modules/timemodule.c | |
parent | bcdd777d3c01a6db3b4357922663624ef617e65a (diff) | |
download | cpython-869e1778c0bcfc0928701c6ae0703934359d036b.zip cpython-869e1778c0bcfc0928701c6ae0703934359d036b.tar.gz cpython-869e1778c0bcfc0928701c6ae0703934359d036b.tar.bz2 |
Issue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING
All these functions only accept positive timeouts, so this change has no effect
in practice.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 3ed3fb3..74c544a 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -221,7 +221,7 @@ static PyObject * time_sleep(PyObject *self, PyObject *obj) { _PyTime_t secs; - if (_PyTime_FromSecondsObject(&secs, obj, _PyTime_ROUND_UP)) + if (_PyTime_FromSecondsObject(&secs, obj, _PyTime_ROUND_CEILING)) return NULL; if (secs < 0) { PyErr_SetString(PyExc_ValueError, @@ -1405,7 +1405,7 @@ pysleep(_PyTime_t secs) do { #ifndef MS_WINDOWS - if (_PyTime_AsTimeval(secs, &timeout, _PyTime_ROUND_UP) < 0) + if (_PyTime_AsTimeval(secs, &timeout, _PyTime_ROUND_CEILING) < 0) return -1; Py_BEGIN_ALLOW_THREADS @@ -1420,7 +1420,7 @@ pysleep(_PyTime_t secs) return -1; } #else - millisecs = _PyTime_AsMilliseconds(secs, _PyTime_ROUND_UP); + millisecs = _PyTime_AsMilliseconds(secs, _PyTime_ROUND_CEILING); if (millisecs > (double)ULONG_MAX) { PyErr_SetString(PyExc_OverflowError, "sleep length is too large"); |