[Python-checkins] python/dist/src/Lib/email MIMEMessage.py,1.4,1.5

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Sun, 02 Jun 2002 12:05:10 -0700


Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv25401/email

Modified Files:
	MIMEMessage.py 
Log Message:
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.


Index: MIMEMessage.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEMessage.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MIMEMessage.py	10 Apr 2002 21:01:30 -0000	1.4
--- MIMEMessage.py	2 Jun 2002 19:05:08 -0000	1.5
***************
*** 5,14 ****
  """
  
! import Message
! import MIMEBase
  
  
  
! class MIMEMessage(MIMEBase.MIMEBase):
      """Class representing message/* MIME documents."""
  
--- 5,14 ----
  """
  
! from email import Message
! from email.MIMENonMultipart import MIMENonMultipart
  
  
  
! class MIMEMessage(MIMENonMultipart):
      """Class representing message/* MIME documents."""
  
***************
*** 23,28 ****
          the term "rfc822" is technically outdated by RFC 2822).
          """
!         MIMEBase.MIMEBase.__init__(self, 'message', _subtype)
          if not isinstance(_msg, Message.Message):
              raise TypeError, 'Argument is not an instance of Message'
!         self.set_payload(_msg)
--- 23,30 ----
          the term "rfc822" is technically outdated by RFC 2822).
          """
!         MIMENonMultipart.__init__(self, 'message', _subtype)
          if not isinstance(_msg, Message.Message):
              raise TypeError, 'Argument is not an instance of Message'
!         # 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)