From 20f4557207c9d63cbc46164e4b40aff9f4d7d7ca Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 18 Oct 2009 03:19:36 +0000 Subject: [PATCH] Implement __len__. (trunk r14598) svn path=/main/branches/2.1.7/; revision=14633 --- 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