mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
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.
This commit is contained in:
parent
7dc865ad72
commit
524af6f382
5 changed files with 23 additions and 22 deletions
|
|
@ -5,12 +5,12 @@
|
|||
"""
|
||||
|
||||
import warnings
|
||||
import MIMEBase
|
||||
from Encoders import encode_7or8bit
|
||||
from email.MIMENonMultipart import MIMENonMultipart
|
||||
from email.Encoders import encode_7or8bit
|
||||
|
||||
|
||||
|
||||
class MIMEText(MIMEBase.MIMEBase):
|
||||
class MIMEText(MIMENonMultipart):
|
||||
"""Class for generating text/* type MIME documents."""
|
||||
|
||||
def __init__(self, _text, _subtype='plain', _charset='us-ascii',
|
||||
|
|
@ -33,8 +33,8 @@ class MIMEText(MIMEBase.MIMEBase):
|
|||
override any header settings indicated by _charset. This is probably
|
||||
not what you want.
|
||||
"""
|
||||
MIMEBase.MIMEBase.__init__(self, 'text', _subtype,
|
||||
**{'charset': _charset})
|
||||
MIMENonMultipart.__init__(self, 'text', _subtype,
|
||||
**{'charset': _charset})
|
||||
if _text and _text[-1] <> '\n':
|
||||
_text += '\n'
|
||||
self.set_payload(_text, _charset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue