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

bin/emerge

index f477aead890db7c3cc1a74bcc2e8de4ce8f4bccf..e139e2a23c4ab78fb985d05f2b61577f4556a15f 100755 (executable)
@@ -3590,8 +3590,7 @@ class depgraph:
                                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]