Remove unnecessary while in SocketIO.readinto (GH-111057)

It is unnecessary after removing "continue" in 6e6c59b (bpo-42357).
This commit is contained in:
sc07kvm 2023-10-20 00:26:30 +03:00 committed by GitHub
parent c9aef19cbf
commit 677d4bc15e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 10 deletions

View File

@ -702,16 +702,15 @@ class SocketIO(io.RawIOBase):
self._checkReadable()
if self._timeout_occurred:
raise OSError("cannot read from timed out object")
while True:
try:
return self._sock.recv_into(b)
except timeout:
self._timeout_occurred = True
raise
except error as e:
if e.errno in _blocking_errnos:
return None
raise
try:
return self._sock.recv_into(b)
except timeout:
self._timeout_occurred = True
raise
except error as e:
if e.errno in _blocking_errnos:
return None
raise
def write(self, b):
"""Write the given bytes or bytearray object *b* to the socket