]> granicus.if.org Git - python/commitdiff
__init__(): Don't attach the subparts if its an empty tuple. If the
authorBarry Warsaw <barry@python.org>
Tue, 9 Jul 2002 02:44:26 +0000 (02:44 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 9 Jul 2002 02:44:26 +0000 (02:44 +0000)
boundary was given in the arguments, call set_boundary().

Lib/email/MIMEMultipart.py

index 53b0af9295433e9049934b618109ecd078537fcb..001c8a8b28c850a06d02edd0242de49645091718 100644 (file)
@@ -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)