From patchwork Tue Feb 22 14:05:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 83972 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B29F5B715B for ; Wed, 23 Feb 2011 01:05:24 +1100 (EST) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by ozlabs.org (Postfix) with ESMTP id 88659B712D for ; Wed, 23 Feb 2011 01:05:22 +1100 (EST) Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Prsrh-0004zH-EE; Tue, 22 Feb 2011 14:05:21 +0000 Received: from [187.126.171.60] (helo=feioso) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Prsrh-00024D-3k; Tue, 22 Feb 2011 14:05:21 +0000 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by feioso (Postfix) with ESMTP id 7EA8C485CE; Tue, 22 Feb 2011 11:05:18 -0300 (BRT) Subject: [PATCH] Use the 'in' operator instead of dict.has_key(), which has been deprecated. To: patchwork@lists.ozlabs.org From: Guilherme Salgado Date: Tue, 22 Feb 2011 11:05:18 -0300 Message-ID: <20110222140518.357.86612.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 Cc: patches@linaro.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org --- 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 == '':