[PATCH] Use the 'in' operator instead of dict.has_key(), which has been deprecated.

Guilherme Salgado guilherme.salgado at linaro.org
Mon Feb 28 23:39:36 EST 2011


Signed-off-by: Guilherme Salgado <guilherme.salgado at linaro.org>
---

(resending with a Signed-off-by: line)

 apps/patchwork/views/base.py   |    2 +-
 apps/patchwork/views/xmlrpc.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py
index 2f6b602..c0e68ed 100644
--- a/apps/patchwork/views/base.py
+++ b/apps/patchwork/views/base.py
@@ -76,7 +76,7 @@ if settings.ENABLE_XMLRPC:
 
 def help(request, path):
     context = PatchworkRequestContext(request)
-    if help_pages.has_key(path):
+    if path in help_pages:
         return render_to_response('patchwork/help/' + help_pages[path], context)
     raise Http404
 
diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py
index 18a8a2b..bb9ebe1 100644
--- a/apps/patchwork/views/xmlrpc.py
+++ b/apps/patchwork/views/xmlrpc.py
@@ -58,9 +58,9 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher):
     def _user_for_request(self, request):
         auth_header = None
 
-        if request.META.has_key('HTTP_AUTHORIZATION'):
+        if 'HTTP_AUTHORIZATION' in request.META:
             auth_header = request.META.get('HTTP_AUTHORIZATION')
-        elif request.META.has_key('Authorization'):
+        elif 'Authorization' in request.META:
             auth_header = request.META.get('Authorization')
 
         if auth_header is None or auth_header == '':



More information about the Patchwork mailing list