summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorДилян Палаузов <dilyanpalauzov@users.noreply.github.com>2017-11-13 16:15:49 -0500
committerTim Graham <timograham@gmail.com>2017-11-14 10:52:52 -0500
commit23bf4ad87f86f44a5ecf9aea722ced76fe7b7fdf (patch)
treeb6951dcd0887643851803becb4ec608eeab6ba68 /django/http
parenta2ec1e6b2d05a1de86a6d02d1e035250b9fefa77 (diff)
Fixed #28795 -- Removed 'not in' checks and used dict.setdefault().
Diffstat (limited to 'django/http')
-rw-r--r--django/http/response.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/http/response.py b/django/http/response.py
index ae14333053..c07dc5b6e0 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -136,10 +136,7 @@ class HttpResponseBase:
self._headers[header.lower()] = (header, value)
def __delitem__(self, header):
- try:
- del self._headers[header.lower()]
- except KeyError:
- pass
+ self._headers.pop(header.lower(), False)
def __getitem__(self, header):
return self._headers[header.lower()][1]