summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-27 04:38:24 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-27 04:38:24 (GMT)
commit67feb09d065aee7a125b226c0249c4db37a1f4f4 (patch)
tree60aa7463254e74c72a82540a50aea855996f5c66
parent97a7f1e4202f1113cab407ffa63e22ce27e5d58b (diff)
downloadcpython-67feb09d065aee7a125b226c0249c4db37a1f4f4.zip
cpython-67feb09d065aee7a125b226c0249c4db37a1f4f4.tar.gz
cpython-67feb09d065aee7a125b226c0249c4db37a1f4f4.tar.bz2
Delete redundant read() and close() methods from SocketIO class.
-rw-r--r--Lib/io.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 4dfab22..96226e4 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -457,33 +457,9 @@ class SocketIO(RawIOBase):
def readinto(self, b):
return self._sock.recv_into(b)
- def read(self, n: int = None) -> bytes:
- """read(n: int) -> bytes. Read and return up to n bytes.
-
- Returns an empty bytes array on EOF, or None if the object is
- set not to block and has no data to read.
- """
- if n is None:
- n = -1
- if n >= 0:
- return RawIOBase.read(self, n)
- # Support reading until the end.
- # XXX Why doesn't RawIOBase support this?
- data = b""
- while True:
- more = RawIOBase.read(self, DEFAULT_BUFFER_SIZE)
- if not more:
- break
- data += more
- return data
-
def write(self, b):
return self._sock.send(b)
- def close(self):
- if not self.closed:
- RawIOBase.close(self)
-
def readable(self):
return "r" in self._mode