From: Zac Medico Date: Fri, 30 May 2008 21:14:32 +0000 (-0000) Subject: Now that dbapi._iter_match() is guaranteed to return a real iterator with X-Git-Tag: v2.2_pre8~59 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b91006f024eac5921e72a1736e48c34618e23dbf;p=portage.git Now that dbapi._iter_match() is guaranteed to return a real iterator with a next method(), we can just call next() and handle StopIteration. svn path=/main/trunk/; revision=10509 --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 685fd18c5..83069bd2c 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -619,10 +619,10 @@ class portdbapi(dbapi): cpv_iter = iter(self.cp_list(mykey)) if mydep != mykey: cpv_iter = self._iter_match(mydep, cpv_iter) - myval = "" - for cpv in cpv_iter: - myval = cpv - break + try: + myval = cpv_iter.next() + except StopIteration: + myval = "" elif level in ("minimum-visible", "bestmatch-visible"): # Find the minimum matching visible version. This is optimized to