]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unnecessary while in SocketIO.readinto (GH-111057)
authorsc07kvm <sc07kvmxoma@mail.ru>
Thu, 19 Oct 2023 21:26:30 +0000 (00:26 +0300)
committerGitHub <noreply@github.com>
Thu, 19 Oct 2023 21:26:30 +0000 (00:26 +0300)
It is unnecessary after removing "continue" in 6e6c59b (bpo-42357).

Lib/socket.py

index 321fcda51505c18d36d5a51e6d51e4170fb25bc3..5f0a1f40e25b941386e5ec2d35c93ddb3d961b63 100644 (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