summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]Lib/smtplib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index b03533e..cb36d28 100644..100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -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