From 8cf07e21b50e9912e569fc5258dd58aee6f0a5ef Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 31 Oct 2010 10:53:31 -0700 Subject: [PATCH] Simplify LazyItemsDict.__deepcopy__(). --- pym/portage/util/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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): -- 2.26.2