mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#20476: add a message_factory policy attribute to email.
This commit is contained in:
parent
37df068e86
commit
06ed218ed0
9 changed files with 128 additions and 66 deletions
|
@ -154,6 +154,8 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta):
|
|||
them. This is used when the message is being
|
||||
serialized by a generator. Default: True.
|
||||
|
||||
message_factory -- the class to use to create new message objects.
|
||||
|
||||
"""
|
||||
|
||||
raise_on_defect = False
|
||||
|
@ -161,6 +163,8 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta):
|
|||
cte_type = '8bit'
|
||||
max_line_length = 78
|
||||
mangle_from_ = False
|
||||
# XXX To avoid circular imports, this is set in email.message.
|
||||
message_factory = None
|
||||
|
||||
def handle_defect(self, obj, defect):
|
||||
"""Based on policy, either raise defect or call register_defect.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue