mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue 11291: poplib suppresses errors on QUIT.
This commit is contained in:
parent
103a6d6cd6
commit
95bcb93041
3 changed files with 25 additions and 9 deletions
|
@ -250,15 +250,18 @@ class POP3:
|
|||
|
||||
def quit(self):
|
||||
"""Signoff: commit changes on server, unlock mailbox, close connection."""
|
||||
try:
|
||||
resp = self._shortcmd('QUIT')
|
||||
except error_proto as val:
|
||||
resp = val
|
||||
self.file.close()
|
||||
self.sock.close()
|
||||
del self.file, self.sock
|
||||
resp = self._shortcmd('QUIT')
|
||||
self.close()
|
||||
return resp
|
||||
|
||||
def close(self):
|
||||
"""Close the connection without assuming anything about it."""
|
||||
if self.file is not None:
|
||||
self.file.close()
|
||||
if self.sock is not None:
|
||||
self.sock.close()
|
||||
self.file = self.sock = None
|
||||
|
||||
#__del__ = quit
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue