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

Provide a better diagnosis on socket errors

üst 29646917
......@@ -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")
......
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