From ff5c09fb29db5910308628aa06d2ffe368c7264a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 1 Jul 2008 12:42:15 +0000 Subject: [PATCH] Py3k compatibility patch #2 by Ali Polatel . Replace dict.has_key() calls with "in" and "not in" operators. svn path=/main/trunk/; revision=10871 --- 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 13d12787e..e25759c4a 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 f32a72844..196039c74 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: -- 2.26.2