diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 217c77c..3c909a6 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1637,7 +1637,7 @@
 
         /* s->sock_timeout is in seconds, timeout in ms */
         timeout = (int)_PyTime_AsMilliseconds(s->sock_timeout,
-                                              _PyTime_ROUND_UP);
+                                              _PyTime_ROUND_CEILING);
 
         PySSL_BEGIN_ALLOW_THREADS
         rc = poll(&pollfd, 1, timeout);
@@ -1651,7 +1651,7 @@
     if (!_PyIsSelectable_fd(s->sock_fd))
         return SOCKET_TOO_LARGE_FOR_SELECT;
 
-    _PyTime_AsTimeval_noraise(s->sock_timeout, &tv, _PyTime_ROUND_UP);
+    _PyTime_AsTimeval_noraise(s->sock_timeout, &tv, _PyTime_ROUND_CEILING);
 
     FD_ZERO(&fds);
     FD_SET(s->sock_fd, &fds);
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 07b01f0..0907aa0 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -59,7 +59,7 @@
         endtime = _PyTime_GetMonotonicClock() + timeout;
 
     do {
-        microseconds = _PyTime_AsMicroseconds(timeout, _PyTime_ROUND_UP);
+        microseconds = _PyTime_AsMicroseconds(timeout, _PyTime_ROUND_CEILING);
 
         /* first a simple non-blocking try without releasing the GIL */
         r = PyThread_acquire_lock_timed(lock, 0, 0);
@@ -110,7 +110,8 @@
         return -1;
 
     if (timeout_obj
-        && _PyTime_FromSecondsObject(timeout, timeout_obj, _PyTime_ROUND_UP) < 0)
+        && _PyTime_FromSecondsObject(timeout,
+                                     timeout_obj, _PyTime_ROUND_CEILING) < 0)
         return -1;
 
     if (!blocking && *timeout != unset_timeout ) {
@@ -128,7 +129,7 @@
     else if (*timeout != unset_timeout) {
         _PyTime_t microseconds;
 
-        microseconds = _PyTime_AsMicroseconds(*timeout, _PyTime_ROUND_UP);
+        microseconds = _PyTime_AsMicroseconds(*timeout, _PyTime_ROUND_CEILING);
         if (microseconds >= PY_TIMEOUT_MAX) {
             PyErr_SetString(PyExc_OverflowError,
                             "timeout value is too large");
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 2c82ce7..a852344 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -209,13 +209,13 @@
     else {
         _PyTime_t ts;
 
-        if (_PyTime_FromSecondsObject(&ts, tout, _PyTime_ROUND_UP) < 0) {
+        if (_PyTime_FromSecondsObject(&ts, tout, _PyTime_ROUND_CEILING) < 0) {
             PyErr_SetString(PyExc_TypeError,
                             "timeout must be a float or None");
             return NULL;
         }
 
-        if (_PyTime_AsTimeval(ts, &tv, _PyTime_ROUND_UP) == -1)
+        if (_PyTime_AsTimeval(ts, &tv, _PyTime_ROUND_CEILING) == -1)
             return NULL;
         if (tv.tv_sec < 0) {
             PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
@@ -2014,7 +2014,8 @@
     else {
         _PyTime_t ts;
 
-        if (_PyTime_FromSecondsObject(&ts, otimeout, _PyTime_ROUND_UP) < 0) {
+        if (_PyTime_FromSecondsObject(&ts,
+                                      otimeout, _PyTime_ROUND_CEILING) < 0) {
             PyErr_Format(PyExc_TypeError,
                 "timeout argument must be an number "
                 "or None, got %.200s",
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index f3b2e29..1b3589d 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -977,7 +977,8 @@
                           &signals, &timeout_obj))
         return NULL;
 
-    if (_PyTime_FromSecondsObject(&timeout, timeout_obj, _PyTime_ROUND_UP) < 0)
+    if (_PyTime_FromSecondsObject(&timeout,
+                                  timeout_obj, _PyTime_ROUND_CEILING) < 0)
         return NULL;
 
     if (timeout < 0) {
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 513405e..a6c47ae 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -633,7 +633,7 @@
     pollfd.events = writing ? POLLOUT : POLLIN;
 
     /* s->sock_timeout is in seconds, timeout in ms */
-    timeout = _PyTime_AsMilliseconds(interval, _PyTime_ROUND_UP);
+    timeout = _PyTime_AsMilliseconds(interval, _PyTime_ROUND_CEILING);
     assert(timeout <= INT_MAX);
     timeout_int = (int)timeout;
 
@@ -641,7 +641,7 @@
     n = poll(&pollfd, 1, timeout_int);
     Py_END_ALLOW_THREADS;
 #else
-    _PyTime_AsTimeval_noraise(interval, &tv, _PyTime_ROUND_UP);
+    _PyTime_AsTimeval_noraise(interval, &tv, _PyTime_ROUND_CEILING);
 
     FD_ZERO(&fds);
     FD_SET(s->sock_fd, &fds);
@@ -2191,7 +2191,8 @@
         return 0;
     }
 
-    if (_PyTime_FromSecondsObject(timeout, timeout_obj, _PyTime_ROUND_UP) < 0)
+    if (_PyTime_FromSecondsObject(timeout,
+                                  timeout_obj, _PyTime_ROUND_CEILING) < 0)
         return -1;
 
     if (*timeout < 0) {
@@ -2200,10 +2201,10 @@
     }
 
 #ifdef MS_WINDOWS
-    overflow = (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_UP) < 0);
+    overflow = (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_CEILING) < 0);
 #endif
 #ifndef HAVE_POLL
-    timeout = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_UP);
+    timeout = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
     overflow = (timeout > INT_MAX);
 #endif
     if (overflow) {
@@ -2452,7 +2453,7 @@
         struct timeval tv;
         int conv;
 
-        _PyTime_AsTimeval_noraise(s->sock_timeout, &tv, _PyTime_ROUND_UP);
+        _PyTime_AsTimeval_noraise(s->sock_timeout, &tv, _PyTime_ROUND_CEILING);
 
         Py_BEGIN_ALLOW_THREADS
         FD_ZERO(&fds);
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 @@
 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 @@
 
     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 @@
             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");
