8000 Fix-up for 0f362676460d: add missing size argument to SSLFakeFile.rea… · python/cpython@786c8e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 786c8e7

Browse files
committed
Fix-up for 0f362676460d: add missing size argument to SSLFakeFile.readline(), as in 2.6 backport 8a6def3add5b
1 parent e558181 commit 786c8e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/smtplib.py

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,14 @@ class SSLFakeFile:
189189
def __init__(self, sslobj):
190190
self.sslobj = sslobj
191191

192-
def readline(self):
192+
def readline(self, size=-1):
193+
if size < 0:
194+
size = None
193195
str = b""
194196
chr = None
195197
while chr != b"\n":
198+
if size is not None and len(str) > size:
199+
break
196200
chr = self.sslobj.read(1)
197201
if not chr:
198202
break

0 commit comments

Comments
 (0)
0