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

login
register
mail settings
Submitter Guilherme Salgado
Date Feb. 22, 2011, 2:05 p.m.
Message ID <20110222140518.357.86612.stgit@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/83972/
State Superseded
Headers show

Comments

Guilherme Salgado - Feb. 22, 2011, 2:05 p.m.
---
 apps/patchwork/views/base.py   |    2 +-
 apps/patchwork/views/xmlrpc.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Patch

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 == '':