Kaydet (Commit) a5dba1ab authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Provide a better diagnosis on socket errors

......@@ -363,8 +363,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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment