summaryrefslogtreecommitdiffstats
path: root/Lib/email/message.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-09-09 22:39:18 (GMT)
committerR David Murray <rdmurray@bitdance.com>2016-09-09 22:39:18 (GMT)
commit06ed218ed0020003ac388572fbcf09b88075b664 (patch)
tree5a44ac4cb9d85a35fe9d8423e6700176f5de8352 /Lib/email/message.py
parent37df068e862c4bbab16da00de72655c4a737ea94 (diff)
downloadcpython-06ed218ed0020003ac388572fbcf09b88075b664.zip
cpython-06ed218ed0020003ac388572fbcf09b88075b664.tar.gz
cpython-06ed218ed0020003ac388572fbcf09b88075b664.tar.bz2
#20476: add a message_factory policy attribute to email.
Diffstat (limited to 'Lib/email/message.py')
-rw-r--r--Lib/email/message.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index c07da43..f4380d9 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -4,18 +4,17 @@
"""Basic message object for the email package object model."""
-__all__ = ['Message']
+__all__ = ['Message', 'EmailMessage']
import re
import uu
import quopri
-import warnings
from io import BytesIO, StringIO
# Intrapackage imports
from email import utils
from email import errors
-from email._policybase import compat32
+from email._policybase import Policy, compat32
from email import charset as _charset
from email._encoded_words import decode_b
Charset = _charset.Charset
@@ -1163,3 +1162,6 @@ class EmailMessage(MIMEPart):
super().set_content(*args, **kw)
if 'MIME-Version' not in self:
self['MIME-Version'] = '1.0'
+
+# Set message_factory on Policy here to avoid a circular import.
+Policy.message_factory = Message