Use enumerate() it iterate over an array.
authorZac Medico <zmedico@gentoo.org>
Sun, 30 Mar 2008 03:42:27 +0000 (03:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Mar 2008 03:42:27 +0000 (03:42 -0000)
svn path=/main/trunk/; revision=9613

pym/_emerge/__init__.py

index 328b7f1e9ce15503e8fc8ea52a73388ac9ed987a..cb369a6b9dd2a3d8e878b320d90e9e0510dcf64c 100644 (file)
@@ -3914,8 +3914,7 @@ class depgraph(object):
                                if myoldbest:
                                        if myinslotlist:
                                                myoldbest = [myoldbest]
-                                       for key in myoldbest:
-                                               pos = myoldbest.index(key)
+                                       for pos, key in enumerate(myoldbest):
                                                key = portage.pkgsplit(key)[1] + "-" + portage.pkgsplit(key)[2]
                                                if key[-3:] == "-r0":
                                                        key = key[:-3]