Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 381c280

Browse files
committed
#20311: revert changes to 3.3 branch for now until experts have decided how to resolve the issue.
1 parent c114353 commit 381c280

3 files changed

Lines changed: 1 addition & 18 deletions

File tree

Lib/test/test_epoll.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,6 @@ def test_unregister_closed(self):
217217
server.close()
218218
ep.unregister(fd)
219219

220-
def test_timeout_rounding(self):
221-
# epoll_wait() has a resolution of 1 millisecond, check if the timeout
222-
# is correctly rounded to the upper bound
223-
epoll = select.epoll()
224-
self.addCleanup(epoll.close)
225-
for timeout in (1e-2, 1e-3, 1e-4):
226-
t0 = time.monotonic()
227-
epoll.poll(timeout)
228-
dt = time.monotonic() - t0
229-
self.assertGreaterEqual(dt, timeout)
230-
231220

232221
def test_main():
233222
support.run_unittest(TestEPoll)

Misc/NEWS

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ Library
6161

6262
- Issue #20374: Fix build with GNU readline >= 6.3.
6363

64-
- Issue #20311: select.epoll.poll() now rounds the timeout away from zero,
65-
instead of rounding towards zero. For example, a timeout of one microsecond
66-
is now rounded to one millisecond, instead of being rounded to zero.
67-
6864
- Issue #20262: Warnings are raised now when duplicate names are added in the
6965
ZIP file or too long ZIP file comment is truncated.
7066

Modules/selectmodule.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,9 +1379,7 @@ pyepoll_poll(pyEpoll_Object *self, PyObject *args, PyObject *kwds)
13791379
return NULL;
13801380
}
13811381
else {
1382-
/* epoll_wait() has a resolution of 1 millisecond, round away from zero
1383-
to wait *at least* dtimeout seconds. */
1384-
timeout = (int)ceil(dtimeout * 1000.0);
1382+
timeout = (int)(dtimeout * 1000.0);
13851383
}
13861384

13871385
if (maxevents == -1) {

0 commit comments

Comments
 (0)