summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-09-09 19:33:40 +0000
committerJannis Leidel <jannis@leidel.info>2011-09-09 19:33:40 +0000
commitfb590bfa9bfdeb622677187552cae707f379c7b1 (patch)
treec830a4d72a15cb942f91054c0cbf9606af1712f0 /django/http
parent7deb25b8dd5aa1ed02b5e30cbc67cd1fb0c3d6e6 (diff)
Replaced `has_key()` calls with `in` to ease Python 3 port. Thanks, Martin von Löwis.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
-rw-r--r--django/http/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 3d928d9f5d..4f1cda7785 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -23,7 +23,7 @@ except ImportError:
import Cookie
# httponly support exists in Python 2.6's Cookie library,
# but not in Python 2.5.
-_morsel_supports_httponly = Cookie.Morsel._reserved.has_key('httponly')
+_morsel_supports_httponly = 'httponly' in Cookie.Morsel._reserved
# Some versions of Python 2.7 and later won't need this encoding bug fix:
_cookie_encodes_correctly = Cookie.SimpleCookie().value_encode(';') == (';', '"\\073"')
# See ticket #13007, http://bugs.python.org/issue2193 and http://trac.edgewall.org/ticket/2256
@@ -591,7 +591,7 @@ class HttpResponse(object):
def has_header(self, header):
"""Case-insensitive check for a header."""
- return self._headers.has_key(header.lower())
+ return header.lower() in self._headers
__contains__ = has_header