diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-10-17 23:30:13 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-10-17 23:30:13 (GMT) |
commit | 685b3495e1fd9853b1ca5960db3e3cb705920d4f (patch) | |
tree | 890832e8c33e710072208220a20175442b9b29a5 /Lib/email | |
parent | d6967320256a65b847cfc64173d12bf818171db5 (diff) | |
download | cpython-685b3495e1fd9853b1ca5960db3e3cb705920d4f.zip cpython-685b3495e1fd9853b1ca5960db3e3cb705920d4f.tar.gz cpython-685b3495e1fd9853b1ca5960db3e3cb705920d4f.tar.bz2 |
#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')
-rw-r--r-- | Lib/email/headerregistry.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/email/headerregistry.py b/Lib/email/headerregistry.py index 1fae950..911a2af 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): |