mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
Remove unnecessary while in SocketIO.readinto (GH-111057)
It is unnecessary after removing "continue" in 6e6c59b (bpo-42357).
This commit is contained in:
parent
c9aef19cbf
commit
677d4bc15e
1 changed files with 9 additions and 10 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue