summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorsc07kvm <sc07kvmxoma@mail.ru>2023-10-19 21:26:30 (GMT)
committerGitHub <noreply@github.com>2023-10-19 21:26:30 (GMT)
commit677d4bc15e999aa57abe7d23d7fac2c34a6fe0ba (patch)
treef5bdf896fdc6710ef624426e5b955bd98d27e112 /Lib/socket.py
parentc9aef19cbf6ee24c5a4a699ca2e83d44600c6405 (diff)
downloadcpython-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.py19
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