#27331: add policy keyword argument to all MIME subclasses.
Patch by Berker Peksag.
diff --git a/Lib/email/mime/text.py b/Lib/email/mime/text.py
index 479928e..87de8d2 100644
--- a/Lib/email/mime/text.py
+++ b/Lib/email/mime/text.py
@@ -14,7 +14,7 @@
class MIMEText(MIMENonMultipart):
"""Class for generating text/* type MIME documents."""
- def __init__(self, _text, _subtype='plain', _charset=None):
+ def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None):
"""Create a text/* type MIME document.
_text is the string for this message object.
@@ -38,7 +38,7 @@
if isinstance(_charset, Charset):
_charset = str(_charset)
- MIMENonMultipart.__init__(self, 'text', _subtype,
+ MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy,
**{'charset': _charset})
self.set_payload(_text, _charset)