mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -6,14 +6,13 @@
|
|||
|
||||
import imghdr
|
||||
|
||||
# Intrapackage imports
|
||||
import MIMEBase
|
||||
import Errors
|
||||
import Encoders
|
||||
from email import Errors
|
||||
from email import Encoders
|
||||
from email.MIMENonMultipart import MIMENonMultipart
|
||||
|
||||
|
||||
|
||||
class MIMEImage(MIMEBase.MIMEBase):
|
||||
class MIMEImage(MIMENonMultipart):
|
||||
"""Class for generating image/* type MIME documents."""
|
||||
|
||||
def __init__(self, _imagedata, _subtype=None,
|
||||
|
@ -41,6 +40,6 @@ class MIMEImage(MIMEBase.MIMEBase):
|
|||
_subtype = imghdr.what(None, _imagedata)
|
||||
if _subtype is None:
|
||||
raise TypeError, 'Could not guess image MIME subtype'
|
||||
MIMEBase.MIMEBase.__init__(self, 'image', _subtype, **_params)
|
||||
MIMENonMultipart.__init__(self, 'image', _subtype, **_params)
|
||||
self.set_payload(_imagedata)
|
||||
_encoder(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue