diff options
| author | Martin v. Löwis <martin@v.loewis.de> | 2003-10-27 14:07:43 +0000 |
|---|---|---|
| committer | Martin v. Löwis <martin@v.loewis.de> | 2003-10-27 14:07:43 +0000 |
| commit | 1a94f3a1b8117f71508e45c31e9368ae321cff8a (patch) | |
| tree | adc7d380fbed091ff8cee52852cfc9e2316249cb /Lib/httplib.py | |
| parent | e86e5b71c87c68309f2404d2b67c07a493128757 (diff) | |
| download | cpython-git-1a94f3a1b8117f71508e45c31e9368ae321cff8a.tar.gz | |
Patch #817854: Add missing operations for SSLFile. Fixes #792101.
Diffstat (limited to 'Lib/httplib.py')
| -rw-r--r-- | Lib/httplib.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py index 03adb43604..9832e474f8 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -910,6 +910,31 @@ class SSLFile(SharedSocketClient): self._buf = all[i:] return line + def readlines(self, sizehint=0): + total = 0 + list = [] + while True: + line = self.readline() + if not line: + break + list.append(line) + total += len(line) + if sizehint and total >= sizehint: + break + return list + + def fileno(self): + return self._sock.fileno() + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + class FakeSocket(SharedSocketClient): class _closedsocket: |
