From 9b60c69cba1a6c86b4ec84dbe1c09676383a4058 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 26 Sep 2009 18:43:40 +0000 Subject: [PATCH] Merged from trunk -r14402:14412 | 14412 | Use dict.__iter__ instead of keys(), since it behaves | | zmedico | identically in python 2 and 3. | svn path=/main/branches/prefix/; revision=14436 --- pym/portage/cache/mappings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py index bd9f082b9..ed6e19ddd 100644 --- a/pym/portage/cache/mappings.py +++ b/pym/portage/cache/mappings.py @@ -67,7 +67,7 @@ class Mapping(object): return repr(dict(self.items())) def __len__(self): - return len(list(self.keys())) + return len(list(self)) if sys.hexversion >= 0x3000000: items = iteritems @@ -80,7 +80,7 @@ class MutableMapping(Mapping): """ def clear(self): - for key in list(self.keys()): + for key in list(self): del self[key] def setdefault(self, key, default=None): -- 2.26.2