Add policy keyword to email.generator.DecodedGenerator.

This commit is contained in:
R David Murray 2016-09-08 17:57:06 -04:00
parent 4c483ad52b
commit 301edfa579
4 changed files with 13 additions and 5 deletions

View file

@ -452,7 +452,8 @@ class DecodedGenerator(Generator):
Like the Generator base class, except that non-text parts are substituted
with a format string representing the part.
"""
def __init__(self, outfp, mangle_from_=None, maxheaderlen=78, fmt=None):
def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, fmt=None, *,
policy=None):
"""Like Generator.__init__() except that an additional optional
argument is allowed.
@ -474,7 +475,8 @@ class DecodedGenerator(Generator):
[Non-text (%(type)s) part of message omitted, filename %(filename)s]
"""
Generator.__init__(self, outfp, mangle_from_, maxheaderlen)
Generator.__init__(self, outfp, mangle_from_, maxheaderlen,
policy=policy)
if fmt is None:
self._fmt = _FMT
else: