diff options
author | Georg Brandl <georg@python.org> | 2008-03-27 13:27:31 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-27 13:27:31 (GMT) |
commit | deaf2cafbded0a3ce7a14952c4346604af65724a (patch) | |
tree | a0983a781dba7ef970cf348162ec17ddd845c415 | |
parent | 6c052fd5233bf18461f18a44335fef3777da2fa6 (diff) | |
download | cpython-deaf2cafbded0a3ce7a14952c4346604af65724a.zip cpython-deaf2cafbded0a3ce7a14952c4346604af65724a.tar.gz cpython-deaf2cafbded0a3ce7a14952c4346604af65724a.tar.bz2 |
#2248: return result of QUIT from quit().
-rw-r--r-- | Doc/library/smtplib.rst | 7 | ||||
-rwxr-xr-x | Lib/smtplib.py | 3 | ||||
-rw-r--r-- | Misc/NEWS | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 0aea80a..3c22f64 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -318,7 +318,12 @@ An :class:`SMTP` instance has the following methods: .. method:: SMTP.quit() - Terminate the SMTP session and close the connection. + Terminate the SMTP session and close the connection. Return the result of + the SMTP ``QUIT`` command. + + .. versionchanged:: 2.6 + Return a value. + Low-level methods corresponding to the standard SMTP/ESMTP commands ``HELP``, ``RSET``, ``NOOP``, ``MAIL``, ``RCPT``, and ``DATA`` are also supported. diff --git a/Lib/smtplib.py b/Lib/smtplib.py index c1b1bec..5ac9fc3 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -726,8 +726,9 @@ class SMTP: def quit(self): """Terminate the SMTP session.""" - self.docmd("quit") + res = self.docmd("quit") self.close() + return res if _have_ssl: @@ -12,7 +12,7 @@ What's New in Python 2.6 alpha 2? Core and builtins ----------------- -- Patch #2477: Added from __future__ import unicode_literals +- Patch #2477: Added from __future__ import unicode_literals. - Added backport of bytearray type. @@ -76,6 +76,8 @@ Extensions Modules Library ------- +- Issue #2248: return the result of the QUIT command. from SMTP.quit(). + - Backport of Python 3.0's io module. - Issue #2482: Make sure that the coefficient of a Decimal is always |