summaryrefslogtreecommitdiff
path: root/Lib/email/_policybase.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-09-09 18:39:18 -0400
committerR David Murray <rdmurray@bitdance.com>2016-09-09 18:39:18 -0400
commit06ed218ed0020003ac388572fbcf09b88075b664 (patch)
tree5a44ac4cb9d85a35fe9d8423e6700176f5de8352 /Lib/email/_policybase.py
parent37df068e862c4bbab16da00de72655c4a737ea94 (diff)
downloadcpython-git-06ed218ed0020003ac388572fbcf09b88075b664.tar.gz
#20476: add a message_factory policy attribute to email.
Diffstat (limited to 'Lib/email/_policybase.py')
-rw-r--r--Lib/email/_policybase.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/email/_policybase.py b/Lib/email/_policybase.py
index c0d98a4f54..d6994844e1 100644
--- a/Lib/email/_policybase.py
+++ b/Lib/email/_policybase.py
@@ -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.