diff options
author | sc07kvm <sc07kvmxoma@mail.ru> | 2023-10-19 21:26:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 21:26:30 (GMT) |
commit | 677d4bc15e999aa57abe7d23d7fac2c34a6fe0ba (patch) | |
tree | f5bdf896fdc6710ef624426e5b955bd98d27e112 /Lib/socket.py | |
parent | c9aef19cbf6ee24c5a4a699ca2e83d44600c6405 (diff) | |
download | cpython-677d4bc15e999aa57abe7d23d7fac2c34a6fe0ba.zip cpython-677d4bc15e999aa57abe7d23d7fac2c34a6fe0ba.tar.gz cpython-677d4bc15e999aa57abe7d23d7fac2c34a6fe0ba.tar.bz2 |
Remove unnecessary while in SocketIO.readinto (GH-111057)
It is unnecessary after removing "continue" in 6e6c59b (bpo-42357).
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 321fcda..5f0a1f4 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -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 |