projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c40728
)
OrderedDict: fix setitem bug #436974
author
Zac Medico
<zmedico@gentoo.org>
Tue, 2 Oct 2012 20:22:57 +0000
(13:22 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Tue, 2 Oct 2012 20:22:57 +0000
(13:22 -0700)
This fixes some strange behavior triggered during fetch, which is only
observable with Python 2.6 since it doesn't have
collections.OrderedDict.
pym/portage/cache/mappings.py
patch
|
blob
|
history
diff --git
a/pym/portage/cache/mappings.py
b/pym/portage/cache/mappings.py
index bc8ce9af80170b5a94bb866a1bb35601363b1b72..cd39a6ea166a61e90be36cdd64a691fa056f673c 100644
(file)
--- a/
pym/portage/cache/mappings.py
+++ b/
pym/portage/cache/mappings.py
@@
-199,10
+199,10
@@
class OrderedDict(UserDict):
return iter(self._order)
def __setitem__(self, key, item):
- if key in self:
- self._order.remove(key)
+ new_key = key not in self
UserDict.__setitem__(self, key, item)
- self._order.append(key)
+ if new_key:
+ self._order.append(key)
def __delitem__(self, key):
UserDict.__delitem__(self, key)