From bbce62ccae17b6db10ecd99e76589b7174f63f55 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 31 Oct 2010 11:15:00 -0700 Subject: [PATCH] Optimize LazyItemsDict.__deepcopy__(). --- pym/portage/util/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index b7a6ed133..6c39f8952 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -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 " + \ -- 2.26.2