Optimize LazyItemsDict.__deepcopy__(). v2.1.9.24
authorZac Medico <zmedico@gentoo.org>
Sun, 31 Oct 2010 18:15:00 +0000 (11:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 31 Oct 2010 18:15:55 +0000 (11:15 -0700)
pym/portage/util/__init__.py

index b7a6ed133c46a463564c8a127063911605efe51e..6c39f895221b8ff379331cf85ee7f2345c5066ad 100644 (file)
@@ -1299,8 +1299,8 @@ class LazyItemsDict(UserDict):
                memo[id(self)] = result
                for k in self:
                        k_copy = deepcopy(k, memo)
-                       if k in self.lazy_items:
-                               lazy_item = self.lazy_items[k]
+                       lazy_item = self.lazy_items.get(k)
+                       if lazy_item is not None:
                                if not lazy_item.singleton:
                                        raise TypeError(_unicode_decode("LazyItemsDict " + \
                                                "deepcopy is unsafe with lazy items that are " + \