]> granicus.if.org Git - python/commitdiff
Issue #4302: Minor corrections to smtplib. (Backport r60975)
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Wed, 10 Dec 2008 09:54:59 +0000 (09:54 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Wed, 10 Dec 2008 09:54:59 +0000 (09:54 +0000)
Lib/smtplib.py
Misc/NEWS

index 1b9739c81a6e7529f67f6b361d96ff3c0699098b..8651ba4167d1c371819e5da5a7f4517d52359b53 100755 (executable)
@@ -315,7 +315,7 @@ class SMTP:
     def send(self, str):
         """Send `str' to the server."""
         if self.debuglevel > 0: print>>stderr, 'send:', repr(str)
-        if self.sock:
+        if hasattr(self, 'sock') and self.sock:
             try:
                 self.sock.sendall(str)
             except socket.error:
@@ -503,7 +503,7 @@ class SMTP:
     vrfy=verify
 
     def expn(self, address):
-        """SMTP 'verify' command -- checks for address validity."""
+        """SMTP 'expn' command -- expands a mailing list."""
         self.putcmd("expn", quoteaddr(address))
         return self.getreply()
 
index 60a4c67de7ab81500a6bde44097e5548e2837836..f6ea81069b9424402db7044c727990963b4f7446 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -104,6 +104,8 @@ Core and builtins
 Library
 -------
 
+- Issue #1776581 and #4302. Minor corrections to smtplib.
+
 - Issue #3774: Fixed an error when create a Tkinter menu item without command
   and then remove it.