diff options
author | Charles-François Natali <cf.natali@gmail.com> | 2013-11-18 17:59:43 (GMT) |
---|---|---|
committer | Charles-François Natali <cf.natali@gmail.com> | 2013-11-18 17:59:43 (GMT) |
commit | f47981f51e5c825b71652ba05a982e7a437c9bce (patch) | |
tree | 47726d7ff9a84e2010a625cd1c082c7c03863e9d /Lib | |
parent | e106e5ce4b995e9b77ecd256c8062e95f74fae04 (diff) | |
download | cpython-f47981f51e5c825b71652ba05a982e7a437c9bce.zip cpython-f47981f51e5c825b71652ba05a982e7a437c9bce.tar.gz cpython-f47981f51e5c825b71652ba05a982e7a437c9bce.tar.bz2 |
selectors: use a single return.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/selectors.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/selectors.py b/Lib/selectors.py index 3971502..261fac6 100644 --- a/Lib/selectors.py +++ b/Lib/selectors.py @@ -140,14 +140,12 @@ class BaseSelector(metaclass=ABCMeta): raise KeyError("{!r} is not registered".format(fileobj)) from None if events != key.events: self.unregister(fileobj) - return self.register(fileobj, events, data) + key = self.register(fileobj, events, data) elif data != key.data: # Use a shortcut to update the data. key = key._replace(data=data) self._fd_to_key[key.fd] = key - return key - else: - return key + return key @abstractmethod def select(self, timeout=None): |