mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Provide a better diagnosis on socket errors
This commit is contained in:
commit
a5dba1abea
1 changed files with 4 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue