#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.
This commit is contained in:
R David Murray 2016-09-10 00:22:25 -04:00
parent c7454ff5fc
commit b067c8fdd1
5 changed files with 9 additions and 8 deletions

View file

@ -24,7 +24,7 @@ class PolicyAPITests(unittest.TestCase):
'cte_type': '8bit',
'raise_on_defect': False,
'mangle_from_': True,
'message_factory': email.message.Message,
'message_factory': None,
}
# These default values are the ones set on email.policy.default.
# If any of these defaults change, the docs must be updated.