From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-portage-dev+bounces-2004-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1KDe0z-0002sm-71
	for garchives@archives.gentoo.org; Tue, 01 Jul 2008 11:27:17 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id B742BE04F6;
	Tue,  1 Jul 2008 11:27:03 +0000 (UTC)
Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.156])
	by pigeon.gentoo.org (Postfix) with ESMTP id 98F69E04F6
	for <gentoo-portage-dev@lists.gentoo.org>; Tue,  1 Jul 2008 11:27:03 +0000 (UTC)
Received: by yw-out-1718.google.com with SMTP id 5so968660ywm.46
        for <gentoo-portage-dev@lists.gentoo.org>; Tue, 01 Jul 2008 04:27:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date
         :message-id:x-mailer:in-reply-to:references:organization:sender;
        bh=4tufAv3I5yMCAlJ+OUFg3uZ7rR6OkIMDKWpE53fsIrc=;
        b=PHJMyvxeSRbQphiXzRw8rz+FgkVuOXREGGWq0OPBMeB7db6dXP8i/ULey57adf7KcH
         FatVlafI2OaMowBhVlCKVIHUZtgZmwokLZsNL1ZkWYl/zn41feRgg0pDHz7HJu+/68N5
         j8zndOFI76D1Awznu+JC7/KOjOqCrpByuljJM=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:subject:date:message-id:x-mailer:in-reply-to:references
         :organization:sender;
        b=VLuHUOejAhY5eUNWlt7Mgv2vCNZGdpbnFLoUZcKb8sB0wj9E99+TWv3hBFWV1QOnvK
         XJ9neYv3/wBsFYk6Cxy1bx4M25ta4eoZF8DcGrFuRdqQg5IpN5lVoauNRL6XN5UDh5ER
         bv+CYrvazwAD+9q0LcNh5RooqMkVLimyJ65aI=
Received: by 10.103.244.19 with SMTP id w19mr2880609mur.68.1214911622609;
        Tue, 01 Jul 2008 04:27:02 -0700 (PDT)
Received: from trippin ( [78.179.56.209])
        by mx.google.com with ESMTPS id s10sm8590221mue.16.2008.07.01.04.27.01
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 01 Jul 2008 04:27:02 -0700 (PDT)
From: Ali Polatel <hawking@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCH 2/6] Replace has_key() with the in operator (portage.cache)
Date: Tue,  1 Jul 2008 14:26:50 +0300
Message-Id: <1214911614-31263-2-git-send-email-hawking@gentoo.org>
X-Mailer: git-send-email 1.5.6.1
In-Reply-To: <1214911614-31263-1-git-send-email-hawking@gentoo.org>
References: <1214911614-31263-1-git-send-email-hawking@gentoo.org>
Organization: Gentoo
Sender: Ali Polatel <polatel@gmail.com>
Precedence: bulk
List-Post: <mailto:gentoo-portage-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-portage-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-portage-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-portage-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-portage-dev.gentoo.org>
X-BeenThere: gentoo-portage-dev@lists.gentoo.org
Reply-to: gentoo-portage-dev@lists.gentoo.org
X-Archives-Salt: a70e91e6-04ff-4ea4-a258-03a53102f338
X-Archives-Hash: 16693cf487037fd9562d7601ca336e1a

---
 pym/portage/cache/metadata_overlay.py |    2 +-
 pym/portage/cache/sql_template.py     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/cache/metadata_overlay.py b/pym/portage/cache/metadata_overlay.py
index 13d1278..e25759c 100644
--- a/pym/portage/cache/metadata_overlay.py
+++ b/pym/portage/cache/metadata_overlay.py
@@ -61,7 +61,7 @@ class database(template.database):
 
 	def _delitem(self, cpv):
 		value = self[cpv] # validates whiteout and/or raises a KeyError when necessary
-		if self.db_ro.has_key(cpv):
+		if cpv in self.db_ro:
 			self.db_rw[cpv] = self._create_whiteout(value)
 		else:
 			del self.db_rw[cpv]
diff --git a/pym/portage/cache/sql_template.py b/pym/portage/cache/sql_template.py
index f32a728..3c5cbd4 100644
--- a/pym/portage/cache/sql_template.py
+++ b/pym/portage/cache/sql_template.py
@@ -150,7 +150,7 @@ class SQLDatabase(template.database):
 			# so we store only what's handed to us and is a known key
 			db_values = []
 			for key in self._known_keys:
-				if values.has_key(key) and values[key] != '':
+				if key in values and values[key] != '':
 					db_values.append({"key":key, "value":values[key]})
 
 			if len(db_values) > 0:
-- 
1.5.6.1

-- 
gentoo-portage-dev@lists.gentoo.org mailing list