Issue #23485: select.devpoll.poll() is now retried when interrupted by a signal

This commit is contained in:
Victor Stinner 2015-03-31 12:10:33 +02:00
parent 4448c08451
commit 45ca48b03d
5 changed files with 85 additions and 49 deletions

View file

@ -351,6 +351,17 @@ class SelectEINTRTest(EINTRBaseTest):
self.stop_alarm()
self.assertGreaterEqual(dt, self.sleep_time)
@unittest.skipUnless(hasattr(select, 'devpoll'), 'need select.devpoll')
def test_devpoll(self):
poller = select.devpoll()
self.addCleanup(poller.close)
t0 = time.monotonic()
poller.poll(self.sleep_time * 1e3)
dt = time.monotonic() - t0
self.stop_alarm()
self.assertGreaterEqual(dt, self.sleep_time)
def test_main():
support.run_unittest(