For consistency, make sure that a normal iterator is always returned
authorZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 20:47:42 +0000 (20:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 20:47:42 +0000 (20:47 -0000)
from dbapi._iter_match() (and never a list). This way the caller can
be sure that the returned object has a next() method. (trunk r10507)

svn path=/main/branches/2.1.2/; revision=10508

pym/portage.py

index 557d27880175662927a00e1647ff85cb78630116..eb6882f47837560e66619a93eecccaee1ba7a83f 100644 (file)
@@ -6331,7 +6331,7 @@ class dbapi(object):
                        self.cp_list(mydep.cp, use_cache=use_cache)))
 
        def _iter_match(self, atom, cpv_iter):
-               cpv_iter = match_from_list(atom, cpv_iter)
+               cpv_iter = iter(match_from_list(atom, cpv_iter))
                if atom.slot:
                        cpv_iter = self._iter_match_slot(atom, cpv_iter)
                return cpv_iter