diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-22 22:29:32 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-22 22:29:32 +0000 |
commit | 3b2a33efdb6690385db6fda0353d6424e591793d (patch) | |
tree | ecf9f32449aadfa0db80480bdb4c36a1e6e9da47 | |
parent | 913507fe04c3a03627e6f2b92690fe68ece54a12 (diff) | |
download | portage-3b2a33efdb6690385db6fda0353d6424e591793d.tar.gz portage-3b2a33efdb6690385db6fda0353d6424e591793d.tar.bz2 portage-3b2a33efdb6690385db6fda0353d6424e591793d.zip |
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
-rw-r--r-- | pym/portage/cache/mappings.py | 10 |
1 files 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 |