diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/smtplib.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 7b97a6a..13c56e1 100644 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -364,8 +364,10 @@ class SMTP: while 1: try: line = self.file.readline() - except socket.error: - line = '' + except socket.error as e: + self.close() + raise SMTPServerDisconnected("Connection unexpectedly closed: " + + str(e)) if not line: self.close() raise SMTPServerDisconnected("Connection unexpectedly closed") |