diff options
Diffstat (limited to 'Lib/poplib.py')
| -rw-r--r-- | Lib/poplib.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py index 13e0f71..43f8305 100644 --- a/Lib/poplib.py +++ b/Lib/poplib.py @@ -259,15 +259,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 @@ -334,7 +337,7 @@ else: hostname - the hostname of the pop3 over ssl server port - port number - keyfile - PEM formatted file that countains your private key + keyfile - PEM formatted file that contains your private key certfile - PEM formatted certificate chain file See the methods of the parent class POP3 for more documentation. |
