8000 From CPython: use a single return in selectors.py. · Python-Repository-Hub/asyncio@8307a7f · GitHub
[go: up one dir, main page]

Skip to content

Commit 8307a7f

Browse files
committed
From CPython: use a single return in selectors.py.
1 parent ab5706c commit 8307a7f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

asyncio/selectors.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,12 @@ def modify(self, fileobj, events, data=None):
140140
raise KeyError("{!r} is not registered".format(fileobj)) from None
141141
if events != key.events:
142142
self.unregister(fileobj)
143-
return self.register(fileobj, events, data)
143+
key = self.register(fileobj, events, data)
144144
elif data != key.data:
145145
# Use a shortcut to update the data.
146146
key = key._replace(data=data)
147147
self._fd_to_key[key.fd] = key
148-
return key
149-
else:
150-
return key
148+
return key
151149

152150
@abstractmethod
153151
def select(self, timeout=None):

0 commit comments

Comments
 (0)
0