Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10510 - main/branches/2.1.2/pym
Date: Fri, 30 May 2008 21:20:18
Message-Id: E1K2C1E-0002Mw-ND@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-30 21:20:11 +0000 (Fri, 30 May 2008)
3 New Revision: 10510
4
5 Modified:
6 main/branches/2.1.2/pym/portage.py
7 Log:
8 Now that dbapi._iter_match() is guaranteed to return a real iterator with
9 a next() method, we can just call next() and handle StopIteration.
10 (trunk r10509)
11
12
13 Modified: main/branches/2.1.2/pym/portage.py
14 ===================================================================
15 --- main/branches/2.1.2/pym/portage.py 2008-05-30 21:14:32 UTC (rev 10509)
16 +++ main/branches/2.1.2/pym/portage.py 2008-05-30 21:20:11 UTC (rev 10510)
17 @@ -7879,10 +7879,10 @@
18 cpv_iter = iter(self.cp_list(mykey))
19 if mydep != mykey:
20 cpv_iter = self._iter_match(mydep, cpv_iter)
21 - myval = ""
22 - for cpv in cpv_iter:
23 - myval = cpv
24 - break
25 + try:
26 + myval = cpv_iter.next()
27 + except StopIteration:
28 + myval = ""
29
30 elif level in ("minimum-visible", "bestmatch-visible"):
31 # Find the minimum matching visible version. This is optimized to
32
33 --
34 gentoo-commits@l.g.o mailing list