summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/virtual.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-01 12:48:57 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-01 12:48:57 +0000
commit5495f72f0c8202728636eb9bdac74ce5009b0d5a (patch)
treef8b6663bcfc5b213b4df9e73a3d1b5928dfa96c4 /pym/portage/dbapi/virtual.py
parentff5c09fb29db5910308628aa06d2ffe368c7264a (diff)
downloadportage-5495f72f0c8202728636eb9bdac74ce5009b0d5a.tar.gz
portage-5495f72f0c8202728636eb9bdac74ce5009b0d5a.tar.bz2
portage-5495f72f0c8202728636eb9bdac74ce5009b0d5a.zip
Py3k compatibility patch #3 by Ali Polatel <hawking@g.o>.
Replace dict.has_key() calls with "in" and "not in" operators. svn path=/main/trunk/; revision=10872
Diffstat (limited to 'pym/portage/dbapi/virtual.py')
-rw-r--r--pym/portage/dbapi/virtual.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pym/portage/dbapi/virtual.py b/pym/portage/dbapi/virtual.py
index 444b5363a..bf90f305b 100644
--- a/pym/portage/dbapi/virtual.py
+++ b/pym/portage/dbapi/virtual.py
@@ -40,7 +40,7 @@ class fakedbapi(dbapi):
return result[:]
def cpv_exists(self, mycpv):
- return self.cpvdict.has_key(mycpv)
+ return mycpv in self.cpvdict
def cp_list(self, mycp, use_cache=1):
cachelist = self._match_cache.get(mycp)
@@ -94,9 +94,9 @@ class fakedbapi(dbapi):
"""Removes a cpv from the list of available packages."""
self._clear_cache()
mycp = cpv_getkey(mycpv)
- if self.cpvdict.has_key(mycpv):
+ if mycpv in self.cpvdict:
del self.cpvdict[mycpv]
- if not self.cpdict.has_key(mycp):
+ if mycp not in self.cpdict:
return
while mycpv in self.cpdict[mycp]:
del self.cpdict[mycp][self.cpdict[mycp].index(mycpv)]
@@ -129,4 +129,4 @@ class testdbapi(object):
fake_api = dir(dbapi)
for call in fake_api:
if not hasattr(self, call):
- setattr(self, call, f) \ No newline at end of file
+ setattr(self, call, f)