diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-12 22:59:32 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-12 22:59:32 +0000 |
commit | 364e7e5d0f7fa3c8d28e812e43effab9d0294cfe (patch) | |
tree | 06f35802a767e2b02ac73fc89a478468c7d6f42e | |
parent | a14dcd275546a6622d5b7ace5a2484e61f419b7e (diff) | |
download | portage-364e7e5d0f7fa3c8d28e812e43effab9d0294cfe.tar.gz portage-364e7e5d0f7fa3c8d28e812e43effab9d0294cfe.tar.bz2 portage-364e7e5d0f7fa3c8d28e812e43effab9d0294cfe.zip |
Implement FetchlistDict.__len__, in order to avoid
infinite recursion in some cases.
svn path=/main/trunk/; revision=14597
-rw-r--r-- | pym/portage/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 299615c4f..fdde3e6d3 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -8611,6 +8611,11 @@ class FetchlistDict(portage.cache.mappings.Mapping): def __iter__(self): return iter(self.portdb.cp_list(self.cp, mytree=self.mytree)) + def __len__(self): + """This needs to be implemented in order to avoid + infinite recursion in some cases.""" + return len(self.portdb.cp_list(self.cp, mytree=self.mytree)) + def keys(self): """Returns keys for all packages within pkgdir""" return self.portdb.cp_list(self.cp, mytree=self.mytree) |