* [gentoo-commits] portage r12777 - main/trunk/pym/portage
@ 2009-03-07 21:34 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-03-07 21:34 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2009-03-07 21:34:50 +0000 (Sat, 07 Mar 2009)
New Revision: 12777
Modified:
main/trunk/pym/portage/util.py
Log:
Fix an issue with incomplete deepcopy of _LazyItem instances inside
LazyItemsDict.__deepcopy__(). Thanks to Arfrever for reporting.
Modified: main/trunk/pym/portage/util.py
===================================================================
--- main/trunk/pym/portage/util.py 2009-03-07 20:25:19 UTC (rev 12776)
+++ main/trunk/pym/portage/util.py 2009-03-07 21:34:50 UTC (rev 12777)
@@ -1170,17 +1170,12 @@
memo[id(self)] = result
for k in self:
k_copy = deepcopy(k, memo)
- if k in self.lazy_items:
+ if k in list(self.lazy_items):
lazy_item = self.lazy_items[k]
- try:
- result.lazy_items[k_copy] = deepcopy(lazy_item, memo)
- except TypeError:
- # If deepcopy fails for a lazy singleton, try to
- # evaluate the singleton and deepcopy the result.
- if not lazy_item.singleton:
- raise
+ if lazy_item.singleton:
dict.__setitem__(result, k_copy, deepcopy(self[k], memo))
else:
+ result.lazy_items[k_copy] = deepcopy(lazy_item, memo)
dict.__setitem__(result, k_copy, None)
else:
dict.__setitem__(result, k_copy, deepcopy(self[k], memo))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-07 21:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-07 21:34 [gentoo-commits] portage r12777 - main/trunk/pym/portage Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox