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

Skip to content

Commit 11892ec

Browse files
committed
Patch #817854: Add missing operations for SSLFile. Fixes #792101.
Backported to 2.3.
1 parent 98779e0 commit 11892ec

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lib/httplib.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,31 @@ def readline(self):
910910
self._buf = all[i:]
911911
return line
912912

913+
def readlines(self, sizehint=0):
914+
total = 0
915+
list = []
916+
while True:
917+
line = self.readline()
918+
if not line:
919+
break
920+
list.append(line)
921+
total += len(line)
922+
if sizehint and total >= sizehint:
923+
break
924+
return list
925+
926+
def fileno(self):
927+
return self._sock.fileno()
928+
929+
def __iter__(self):
930+
return self
931+
932+
def next(self):
933+
line = self.readline()
934+
if not line:
935+
raise StopIteration
936+
return line
937+
913938
class FakeSocket(SharedSocketClient):
914939

915940
class _closedsocket:

0 commit comments

Comments
 (0)