summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index b28de1d..7658c07 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -228,10 +228,14 @@ class _fileobject:
data, self._rbuf = self._rbuf[:i], self._rbuf[i:]
return data
- def readlines(self):
+ def readlines(self, sizehint = 0):
+ total = 0
list = []
while 1:
line = self.readline()
if not line: break
list.append(line)
+ total += len(line)
+ if sizehint and total >= sizehint:
+ break
return list