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

login
register
mail settings
Submitter Guilherme Salgado
Date Feb. 28, 2011, 12:39 p.m.
Message ID <20110228123921.11728.50039.stgit@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/84829/
State Accepted
Commit a7bbbeba8f1dd2e859767c4873f584ea87afd77d
Headers show

Comments

Guilherme Salgado - Feb. 28, 2011, 12:39 p.m.
Signed-off-by: Guilherme Salgado <guilherme.salgado@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(-)
Jeremy Kerr - March 30, 2011, 7:04 a.m.
Hi Guilherme,

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

Thanks, applied


Jeremy

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