mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
selectors: use a single return.
This commit is contained in:
parent
e106e5ce4b
commit
f47981f51e
1 changed files with 2 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue