diff options
author | Guido van Rossum <guido@python.org> | 2013-12-07 23:57:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2013-12-07 23:57:01 (GMT) |
commit | 9710ff04ac17a72bdf4bdd9f3222ec435d717671 (patch) | |
tree | 57af046a738d3681ba9d1c9e12352eb26a6be9a8 /Doc/library/selectors.rst | |
parent | 647cd87169d79b4ab4ad084104dc152381cca339 (diff) | |
download | cpython-9710ff04ac17a72bdf4bdd9f3222ec435d717671.zip cpython-9710ff04ac17a72bdf4bdd9f3222ec435d717671.tar.gz cpython-9710ff04ac17a72bdf4bdd9f3222ec435d717671.tar.bz2 |
Silently ignore unregistering closed files. Fixes issue 19876. With docs and slight test refactor.
Diffstat (limited to 'Doc/library/selectors.rst')
-rw-r--r-- | Doc/library/selectors.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/selectors.rst b/Doc/library/selectors.rst index b0b002f..98377c8 100644 --- a/Doc/library/selectors.rst +++ b/Doc/library/selectors.rst @@ -102,7 +102,8 @@ below: Register a file object for selection, monitoring it for I/O events. - *fileobj* is the file object to monitor. + *fileobj* is the file object to monitor. It may either be an integer + file descriptor or an object with a ``fileno()`` method. *events* is a bitwise mask of events to monitor. *data* is an opaque object. @@ -118,7 +119,9 @@ below: *fileobj* must be a file object previously registered. This returns the associated :class:`SelectorKey` instance, or raises a - :exc:`KeyError` if the file object is not registered. + :exc:`KeyError` if *fileobj* is not registered. It will raise + :exc:`ValueError` if *fileobj* is invalid (e.g. it has no ``fileno()`` + method or its ``fileno()`` method has an invalid return value). .. method:: modify(fileobj, events, data=None) |