]> granicus.if.org Git - python/commitdiff
Fixed an example in the use of email.Utils.getaddresses(). The
authorBarry Warsaw <barry@python.org>
Mon, 22 Oct 2001 20:53:45 +0000 (20:53 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 22 Oct 2001 20:53:45 +0000 (20:53 +0000)
failobj has to be a list or the `+' can fail.

Doc/lib/emailutil.tex

index d4a7313d91119aa86c15161dfa02dfe0525f0fd1..a5030d21b52f8b7adc61ef7197d8ef1ef3c6aeaf 100644 (file)
@@ -40,10 +40,10 @@ simple example that gets all the recipients of a message:
 \begin{verbatim}
 from email.Utils import getaddresses
 
-tos = msg.get_all('to')
-ccs = msg.get_all('cc')
-resent_tos = msg.get_all('resent-to')
-resent_ccs = msg.get_all('resent-cc')
+tos = msg.get_all('to', [])
+ccs = msg.get_all('cc', [])
+resent_tos = msg.get_all('resent-to', [])
+resent_ccs = msg.get_all('resent-cc', [])
 all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)
 \end{verbatim}
 \end{funcdesc}