]> granicus.if.org Git - python/commitdiff
#2248: return result of QUIT from quit().
authorGeorg Brandl <georg@python.org>
Thu, 27 Mar 2008 13:27:31 +0000 (13:27 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 27 Mar 2008 13:27:31 +0000 (13:27 +0000)
Doc/library/smtplib.rst
Lib/smtplib.py
Misc/NEWS

index 0aea80ab8ba15dcb0117c64ea6c878aa600a1b91..3c22f642349c601164fabb3fc1da9a164c6f407d 100644 (file)
@@ -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.
index c1b1beca4079b14d77bf3044d9a348ba0254822c..5ac9fc36b17242bdb782741c0e290d1133b0e3d1 100755 (executable)
@@ -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:
 
index ce72fbab14692444c7b3732b150c20c4ac8f56ce..ec657053b4792e913578d5a40a32f3ceaca80882 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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