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

View file

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