From 85ca42405c1114111defb777cfd4f94725708b28 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 13 Oct 2009 02:35:24 +0000 Subject: [PATCH] Implement __len__. svn path=/main/trunk/; revision=14598 --- pym/_emerge/BlockerCache.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pym/_emerge/BlockerCache.py b/pym/_emerge/BlockerCache.py index f88a7c43f..de3b65e22 100644 --- a/pym/_emerge/BlockerCache.py +++ b/pym/_emerge/BlockerCache.py @@ -165,6 +165,11 @@ class BlockerCache(portage.cache.mappings.MutableMapping): return iter([]) return iter(self._cache_data["blockers"]) + def __len__(self): + """This needs to be implemented in order to avoid + infinite recursion in some cases.""" + return len(self._cache_data["blockers"]) + def __delitem__(self, cpv): del self._cache_data["blockers"][cpv] -- 2.26.2