mirror of https://github.com/python/cpython.git
Issue 4929: Handle socket errors when receiving
This commit is contained in:
parent
a200dd5584
commit
51a035e383
|
@ -334,7 +334,10 @@ def getreply(self):
|
||||||
if self.file is None:
|
if self.file is None:
|
||||||
self.file = self.sock.makefile('rb')
|
self.file = self.sock.makefile('rb')
|
||||||
while 1:
|
while 1:
|
||||||
|
try:
|
||||||
line = self.file.readline()
|
line = self.file.readline()
|
||||||
|
except socket.error:
|
||||||
|
line = ''
|
||||||
if line == '':
|
if line == '':
|
||||||
self.close()
|
self.close()
|
||||||
raise SMTPServerDisconnected("Connection unexpectedly closed")
|
raise SMTPServerDisconnected("Connection unexpectedly closed")
|
||||||
|
|
Loading…
Reference in New Issue