From: Zac Medico Date: Sun, 31 Oct 2010 17:53:31 +0000 (-0700) Subject: Simplify LazyItemsDict.__deepcopy__(). X-Git-Tag: v2.1.9.24~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8cf07e21b50e9912e569fc5258dd58aee6f0a5ef;p=portage.git Simplify LazyItemsDict.__deepcopy__(). --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 237ede658..b7a6ed133 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -1302,13 +1302,10 @@ class LazyItemsDict(UserDict): if k in self.lazy_items: lazy_item = self.lazy_items[k] if not lazy_item.singleton: - raise TypeError("LazyItemsDict deepcopy is " + \ - "unsafe with lazy items that " + \ - "are not singletons: %s" % (lazy_item,)) - UserDict.__setitem__(result, - k_copy, deepcopy(self[k], memo)) - else: - UserDict.__setitem__(result, k_copy, deepcopy(self[k], memo)) + raise TypeError(_unicode_decode("LazyItemsDict " + \ + "deepcopy is unsafe with lazy items that are " + \ + "not singletons: key=%s value=%s") % (k, lazy_item,)) + UserDict.__setitem__(result, k_copy, deepcopy(self[k], memo)) return result class _LazyItem(object):