diff options
author | Barry Warsaw <barry@python.org> | 2004-05-09 18:04:24 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2004-05-09 18:04:24 (GMT) |
commit | d2856008839aa2dd06893701db6be2333eef5f24 (patch) | |
tree | d78fbe0c3abffacbd0c1621b1c377b3b972d4427 | |
parent | bfe18c096fbd04cf32f629ebcce7a6b45b250fe7 (diff) | |
download | cpython-d2856008839aa2dd06893701db6be2333eef5f24.zip cpython-d2856008839aa2dd06893701db6be2333eef5f24.tar.gz cpython-d2856008839aa2dd06893701db6be2333eef5f24.tar.bz2 |
SF patch # 884030 by Amit Aronovitch; fixes the _subpart argument to match
documented semantics.
-rw-r--r-- | Lib/email/MIMEMultipart.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/email/MIMEMultipart.py b/Lib/email/MIMEMultipart.py index 16add2f..ea6ae0c 100644 --- a/Lib/email/MIMEMultipart.py +++ b/Lib/email/MIMEMultipart.py @@ -1,5 +1,5 @@ -# Copyright (C) 2002 Python Software Foundation -# Author: barry@zope.com (Barry Warsaw) +# Copyright (C) 2002-2004 Python Software Foundation +# Author: barry@python.org (Barry Warsaw) """Base class for MIME multipart/* type messages. """ @@ -11,7 +11,8 @@ from email import MIMEBase class MIMEMultipart(MIMEBase.MIMEBase): """Base class for MIME multipart/* type messages.""" - def __init__(self, _subtype='mixed', boundary=None, *_subparts, **_params): + def __init__(self, _subtype='mixed', boundary=None, _subparts=None, + **_params): """Creates a multipart/* type message. By default, creates a multipart/mixed message, with proper @@ -24,7 +25,7 @@ class MIMEMultipart(MIMEBase.MIMEBase): calculated as needed. _subparts is a sequence of initial subparts for the payload. It - must be possible to convert this sequence to a list. You can always + must be an iterable object, such as a list. You can always attach new subparts to the message by using the attach() method. Additional parameters for the Content-Type header are taken from the @@ -32,6 +33,7 @@ class MIMEMultipart(MIMEBase.MIMEBase): """ MIMEBase.MIMEBase.__init__(self, 'multipart', _subtype, **_params) if _subparts: - self.attach(*list(_subparts)) + for p in _subparts: + self.attach(p) if boundary: self.set_boundary(boundary) |