From: Zac Medico Date: Sat, 7 Mar 2009 21:34:50 +0000 (-0000) Subject: Fix an issue with incomplete deepcopy of _LazyItem instances inside X-Git-Tag: v2.2_rc24~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3bb82f58811fc635c24439e4addbee8412bf7d26;p=portage.git Fix an issue with incomplete deepcopy of _LazyItem instances inside LazyItemsDict.__deepcopy__(). Thanks to Arfrever for reporting. svn path=/main/trunk/; revision=12777 --- diff --git a/pym/portage/util.py b/pym/portage/util.py index c84f351be..c55da0366 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -1170,17 +1170,12 @@ class LazyItemsDict(dict): 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))