summaryrefslogtreecommitdiff
path: root/Lib/email/headerregistry.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-10-17 19:30:13 -0400
committerR David Murray <rdmurray@bitdance.com>2014-10-17 19:30:13 -0400
commit0c32163a8225f897839a3d63617e0afd7dde4119 (patch)
tree39500d6628b5e1e6ee381ff62e99f7fbc954e9d3 /Lib/email/headerregistry.py
parentce7470aed601c4a173a7a4fcb403df8bf7b11835 (diff)
downloadcpython-0c32163a8225f897839a3d63617e0afd7dde4119.tar.gz
#21991: make headerregistry params property MappingProxyType.
It is unlikely anyone is using the fact that the dictionary returned by the 'params' attribute was previously writable, but even if someone is the API is provisional so this kind of change is acceptable (and needed, to get the API "right" before it becomes official). Patch by St?phane Wirtel.
Diffstat (limited to 'Lib/email/headerregistry.py')
-rw-r--r--Lib/email/headerregistry.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/email/headerregistry.py b/Lib/email/headerregistry.py
index 1fae950820..911a2afea7 100644
--- a/Lib/email/headerregistry.py
+++ b/Lib/email/headerregistry.py
@@ -7,6 +7,7 @@ Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.
"""
+from types import MappingProxyType
from email import utils
from email import errors
@@ -454,7 +455,7 @@ class ParameterizedMIMEHeader:
@property
def params(self):
- return self._params.copy()
+ return MappingProxyType(self._params)
class ContentTypeHeader(ParameterizedMIMEHeader):