From df8d7c3a2a75c15905177c2b8418704968f20aa7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 30 May 2008 21:20:11 +0000 Subject: Now that dbapi._iter_match() is guaranteed to return a real iterator with a next() method, we can just call next() and handle StopIteration. (trunk r10509) svn path=/main/branches/2.1.2/; revision=10510 --- pym/portage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pym/portage.py') diff --git a/pym/portage.py b/pym/portage.py index eb6882f47..3219a2dcc 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7879,10 +7879,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 -- cgit v1.2.3-1-g7c22