public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10510 - main/branches/2.1.2/pym
@ 2008-05-30 21:20 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-05-30 21:20 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-05-30 21:20:11 +0000 (Fri, 30 May 2008)
New Revision: 10510

Modified:
   main/branches/2.1.2/pym/portage.py
Log:
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)


Modified: main/branches/2.1.2/pym/portage.py
===================================================================
--- main/branches/2.1.2/pym/portage.py	2008-05-30 21:14:32 UTC (rev 10509)
+++ main/branches/2.1.2/pym/portage.py	2008-05-30 21:20:11 UTC (rev 10510)
@@ -7879,10 +7879,10 @@
 			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

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-30 21:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-30 21:20 [gentoo-commits] portage r10510 - main/branches/2.1.2/pym Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox