Implement __len__.
authorZac Medico <zmedico@gentoo.org>
Tue, 13 Oct 2009 02:35:24 +0000 (02:35 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 13 Oct 2009 02:35:24 +0000 (02:35 -0000)
svn path=/main/trunk/; revision=14598

pym/_emerge/BlockerCache.py

index f88a7c43f16c5b41f9b384acaa7730c45f792386..de3b65e2267628d28dc0b48ecaaa3bacfb9b519b 100644 (file)
@@ -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]