summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index d59e6b1..0a12a97 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -336,7 +336,10 @@ class SMTP:
if self.file is None:
self.file = self.sock.makefile('rb')
while 1:
- line = self.file.readline()
+ try:
+ line = self.file.readline()
+ except socket.error:
+ line = ''
if not line:
self.close()
raise SMTPServerDisconnected("Connection unexpectedly closed")