summaryrefslogtreecommitdiffstats
path: root/Lib/email/message.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-09-10 04:22:25 (GMT)
committerR David Murray <rdmurray@bitdance.com>2016-09-10 04:22:25 (GMT)
commitb067c8fdd1e205bd0411417b6d5e4b832c3773fc (patch)
tree1bd428963f46ae7cec4bceedfc9c3a049ce3102e /Lib/email/message.py
parentc7454ff5fcd8d216495990df7db11be73e273a33 (diff)
downloadcpython-b067c8fdd1e205bd0411417b6d5e4b832c3773fc.zip
cpython-b067c8fdd1e205bd0411417b6d5e4b832c3773fc.tar.gz
cpython-b067c8fdd1e205bd0411417b6d5e4b832c3773fc.tar.bz2
#20476: Deal with the message_factory circular import differently.
It turns out we can't depend on email.message getting imported every place message_factory is needed, so to avoid a circular import we need to special case Policy.message_factory=None in the parser instead of using monkey patching. I had a feeling that was a bad idea when I did it.
Diffstat (limited to 'Lib/email/message.py')
-rw-r--r--Lib/email/message.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index f4380d9..b6512f2 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -1162,6 +1162,3 @@ 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