diff options
author | R David Murray <rdmurray@bitdance.com> | 2016-09-07 16:48:35 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2016-09-07 16:48:35 -0400 |
commit | 56b1f1b4d5edef1ca6184225145cffc59d2b3b5d (patch) | |
tree | 305f7b097d8798b86f376a10cc27f928cb27d7a2 /Lib/email/mime/image.py | |
parent | 3788b85628eb9e8e802374303e14c04b6a817d97 (diff) | |
download | cpython-git-56b1f1b4d5edef1ca6184225145cffc59d2b3b5d.tar.gz |
#27331: add policy keyword argument to all MIME subclasses.
Patch by Berker Peksag.
Diffstat (limited to 'Lib/email/mime/image.py')
-rw-r--r-- | Lib/email/mime/image.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/email/mime/image.py b/Lib/email/mime/image.py index 5563823239..92724643cd 100644 --- a/Lib/email/mime/image.py +++ b/Lib/email/mime/image.py @@ -17,7 +17,7 @@ class MIMEImage(MIMENonMultipart): """Class for generating image/* type MIME documents.""" def __init__(self, _imagedata, _subtype=None, - _encoder=encoders.encode_base64, **_params): + _encoder=encoders.encode_base64, *, policy=None, **_params): """Create an image/* type MIME document. _imagedata is a string containing the raw image data. If this data @@ -41,6 +41,7 @@ class MIMEImage(MIMENonMultipart): _subtype = imghdr.what(None, _imagedata) if _subtype is None: raise TypeError('Could not guess image MIME subtype') - MIMENonMultipart.__init__(self, 'image', _subtype, **_params) + MIMENonMultipart.__init__(self, 'image', _subtype, policy=policy, + **_params) self.set_payload(_imagedata) _encoder(self) |