]> granicus.if.org Git - python/commitdiff
Fix-up for 0f362676460d: add missing size argument to SSLFakeFile.readline(), as...
authorGeorg Brandl <georg@python.org>
Tue, 30 Sep 2014 14:31:21 +0000 (16:31 +0200)
committerGeorg Brandl <georg@python.org>
Tue, 30 Sep 2014 14:31:21 +0000 (16:31 +0200)
Lib/smtplib.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b03533e..cb36d28
@@ -189,10 +189,14 @@ else:
         def __init__(self, sslobj):
             self.sslobj = sslobj
 
-        def readline(self):
+        def readline(self, size=-1):
+            if size < 0:
+                size = None
             str = b""
             chr = None
             while chr != b"\n":
+                if size is not None and len(str) > size:
+                    break
                 chr = self.sslobj.read(1)
                 if not chr:
                     break