From 3b2a33efdb6690385db6fda0353d6424e591793d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 22 Sep 2009 22:29:32 +0000 Subject: [PATCH] Make SlotDict use call self.iteritems() where appropriate since it implements that method even when running in python 3.x. svn path=/main/trunk/; revision=14390 --- pym/portage/cache/mappings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py index a6c111897..38a3bfe34 100644 --- a/pym/portage/cache/mappings.py +++ b/pym/portage/cache/mappings.py @@ -333,12 +333,12 @@ def slot_dict_class(keys, prefix="_val_"): self.update(kwargs) def __iter__(self): - for k, v in self.items(): + for k, v in self.iteritems(): yield k def __len__(self): l = 0 - for i in self.items(): + for i in self.iteritems(): l += 1 return l @@ -356,7 +356,7 @@ def slot_dict_class(keys, prefix="_val_"): return list(self.iteritems()) def itervalues(self): - for k, v in self.items(): + for k, v in self.iteritems(): yield v def values(self): @@ -442,7 +442,7 @@ def slot_dict_class(keys, prefix="_val_"): def popitem(self): try: - k, v = next(iter(self.items())) + k, v = self.iteritems().next() except StopIteration: raise KeyError('container is empty') del self[k] @@ -461,7 +461,7 @@ def slot_dict_class(keys, prefix="_val_"): pass def __str__(self): - return str(dict(self.items())) + return str(dict(self.iteritems())) if sys.hexversion >= 0x3000000: items = iteritems -- 2.26.2