summaryrefslogtreecommitdiff
path: root/Lib/email/MIMEMessage.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-06-02 19:05:08 +0000
committerBarry Warsaw <barry@python.org>2002-06-02 19:05:08 +0000
commit524af6f382d1d287763018abc7c6415bb3dad9b5 (patch)
tree4ffc8af7c52b7b82e0d9038852e2c9b81544f01a /Lib/email/MIMEMessage.py
parent7dc865ad726d27a263143865bda59c1a70fde0db (diff)
downloadcpython-git-524af6f382d1d287763018abc7c6415bb3dad9b5.tar.gz
Use absolute import paths for intrapackage imports.
Use MIMENonMultipart as the base class so that you can't attach() to these non-multipart message types.
Diffstat (limited to 'Lib/email/MIMEMessage.py')
-rw-r--r--Lib/email/MIMEMessage.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/email/MIMEMessage.py b/Lib/email/MIMEMessage.py
index 89da92503a..8fa86cb5b4 100644
--- a/Lib/email/MIMEMessage.py
+++ b/Lib/email/MIMEMessage.py
@@ -4,12 +4,12 @@
"""Class representing message/* MIME documents.
"""
-import Message
-import MIMEBase
+from email import Message
+from email.MIMENonMultipart import MIMENonMultipart
-class MIMEMessage(MIMEBase.MIMEBase):
+class MIMEMessage(MIMENonMultipart):
"""Class representing message/* MIME documents."""
def __init__(self, _msg, _subtype='rfc822'):
@@ -22,7 +22,9 @@ class MIMEMessage(MIMEBase.MIMEBase):
default is "rfc822" (this is defined by the MIME standard, even though
the term "rfc822" is technically outdated by RFC 2822).
"""
- MIMEBase.MIMEBase.__init__(self, 'message', _subtype)
+ MIMENonMultipart.__init__(self, 'message', _subtype)
if not isinstance(_msg, Message.Message):
raise TypeError, 'Argument is not an instance of Message'
- self.set_payload(_msg)
+ # It's convenient to use this base class method. We need to do it
+ # this way or we'll get an exception
+ Message.Message.attach(self, _msg)