Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67feb09

Browse files
committed
Delete redundant read() and close() methods from SocketIO class.
1 parent 97a7f1e commit 67feb09

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

Lib/io.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -457,33 +457,9 @@ def __init__(self, sock, mode):
457457
def readinto(self, b):
458458
return self._sock.recv_into(b)
459459

460-
def read(self, n: int = None) -> bytes:
461-
"""read(n: int) -> bytes. Read and return up to n bytes.
462-
463-
Returns an empty bytes array on EOF, or None if the object is
464-
set not to block and has no data to read.
465-
"""
466-
if n is None:
467-
n = -1
468-
if n >= 0:
469-
return RawIOBase.read(self, n)
470-
# Support reading until the end.
471-
# XXX Why doesn't RawIOBase support this?
472-
data = b""
473-
while True:
474-
more = RawIOBase.read(self, DEFAULT_BUFFER_SIZE)
475-
if not more:
476-
break
477-
data += more
478-
return data
479-
480460
def write(self, b):
481461
return self._sock.send(b)
482462

483-
def close(self):
484-
if not self.closed:
485-
RawIOBase.close(self)
486-
487463
def readable(self):
488464
return "r" in self._mode
489465

0 commit comments

Comments
 (0)