diff options
author | Barry Warsaw <barry@python.org> | 2002-07-09 02:44:26 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2002-07-09 02:44:26 (GMT) |
commit | bb493a7039ca56e7f7471128340ad3d854da0305 (patch) | |
tree | b37b628ba652f157e74382522b9f5b1e26bdf136 /Lib | |
parent | 93c40f0c3a9e96f46e51d92c3bfa8ac50012902b (diff) | |
download | cpython-bb493a7039ca56e7f7471128340ad3d854da0305.zip cpython-bb493a7039ca56e7f7471128340ad3d854da0305.tar.gz cpython-bb493a7039ca56e7f7471128340ad3d854da0305.tar.bz2 |
__init__(): Don't attach the subparts if its an empty tuple. If the
boundary was given in the arguments, call set_boundary().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/email/MIMEMultipart.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/email/MIMEMultipart.py b/Lib/email/MIMEMultipart.py index 53b0af9..001c8a8 100644 --- a/Lib/email/MIMEMultipart.py +++ b/Lib/email/MIMEMultipart.py @@ -30,5 +30,8 @@ class MIMEMultipart(MIMEBase.MIMEBase): Additional parameters for the Content-Type: header are taken from the keyword arguments (or passed into the _params argument). """ - MIMEBase.MIMEBase.__init__(self, 'multipart', _subtype, **params) - self.attach(*list(_subparts)) + MIMEBase.MIMEBase.__init__(self, 'multipart', _subtype, **_params) + if _subparts: + self.attach(*list(_subparts)) + if boundary: + self.set_boundary(boundary) |