1 |
Author: zmedico |
2 |
Date: 2008-05-30 21:14:32 +0000 (Fri, 30 May 2008) |
3 |
New Revision: 10509 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/dbapi/porttree.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 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/dbapi/porttree.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/dbapi/porttree.py 2008-05-30 20:47:42 UTC (rev 10508) |
15 |
+++ main/trunk/pym/portage/dbapi/porttree.py 2008-05-30 21:14:32 UTC (rev 10509) |
16 |
@@ -619,10 +619,10 @@ |
17 |
cpv_iter = iter(self.cp_list(mykey)) |
18 |
if mydep != mykey: |
19 |
cpv_iter = self._iter_match(mydep, cpv_iter) |
20 |
- myval = "" |
21 |
- for cpv in cpv_iter: |
22 |
- myval = cpv |
23 |
- break |
24 |
+ try: |
25 |
+ myval = cpv_iter.next() |
26 |
+ except StopIteration: |
27 |
+ myval = "" |
28 |
|
29 |
elif level in ("minimum-visible", "bestmatch-visible"): |
30 |
# Find the minimum matching visible version. This is optimized to |
31 |
|
32 |
-- |
33 |
gentoo-commits@l.g.o mailing list |