cpython: 76d297869859 (original) (raw)

Mercurial > cpython

changeset 95315:76d297869859

Issue #23485: Enhance and update selectors doc and test_selectors Selector.select() is now retried with the recomputed timeout when interrupted by a signal. Write an unit test with a signal handler raising an exception, and a unit with a signal handler which does not raise an exception (it does nothing). [#23485]

Victor Stinner victor.stinner@gmail.com
date Tue, 31 Mar 2015 12:08:09 +0200
parents f54bc2c52dfd
children 475461033bb2
files Doc/library/selectors.rst Lib/test/test_selectors.py
diffstat 2 files changed, 40 insertions(+), 3 deletions(-)[+] [-] Doc/library/selectors.rst 6 Lib/test/test_selectors.py 37

line wrap: on

line diff

--- a/Doc/library/selectors.rst +++ b/Doc/library/selectors.rst @@ -159,6 +159,12 @@ below: timeout has elapsed if the current process receives a signal: in this case, an empty list will be returned.

+ .. method:: close() Close the selector.

--- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -357,7 +357,35 @@ class BaseSelectorTestCase(unittest.Test @unittest.skipUnless(hasattr(signal, "alarm"), "signal.alarm() required for this test")

+

+

+

+

+

+

+

@@ -371,8 +399,11 @@ class BaseSelectorTestCase(unittest.Test s.register(rd, selectors.EVENT_READ) t = time()

class ScalableSelectorMixIn: