Simplify LazyItemsDict.__deepcopy__().
authorZac Medico <zmedico@gentoo.org>
Sun, 31 Oct 2010 17:53:31 +0000 (10:53 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 31 Oct 2010 18:02:36 +0000 (11:02 -0700)
pym/portage/util/__init__.py

index 237ede65852df3a2f47bb032e1bb332ba1b869f7..b7a6ed133c46a463564c8a127063911605efe51e 100644 (file)
@@ -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):