Use next(iterator) instead of iterator.next() for compatibility with Python 3.
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Mon, 21 Sep 2009 18:14:01 +0000 (18:14 -0000)
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Mon, 21 Sep 2009 18:14:01 +0000 (18:14 -0000)
(2to3-3.1 -f next -nw ${FILES})

svn path=/main/trunk/; revision=14355

pym/_emerge/BlockerDB.py
pym/_emerge/MetadataRegen.py
pym/_emerge/depgraph.py
pym/_emerge/unmerge.py
pym/portage/cache/mappings.py
pym/portage/dbapi/porttree.py
pym/portage/dep.py

index 1c4af1cae2fe5e53467da799de3b2b9e47456047..8367ec6513a09e8f61b05f645f31d03006b4bca1 100644 (file)
@@ -119,7 +119,7 @@ class BlockerDB(object):
                        blocker_atoms = InternalPackageSet(initial_atoms=blocker_atoms)
                        for inst_pkg in installed_pkgs:
                                try:
-                                       blocker_atoms.iterAtomsForPackage(inst_pkg).next()
+                                       next(blocker_atoms.iterAtomsForPackage(inst_pkg))
                                except (portage.exception.InvalidDependString, StopIteration):
                                        continue
                                blocking_pkgs.add(inst_pkg)
index 88b157fd0f4e20be5b56defd369ad337e0b8d9cb..6bfd722c262cd250cba474463e673689359d9425 100644 (file)
@@ -135,7 +135,7 @@ class MetadataRegen(PollScheduler):
                """
                while self._can_add_job():
                        try:
-                               metadata_process = self._process_iter.next()
+                               metadata_process = next(self._process_iter)
                        except StopIteration:
                                return False
 
index d20016c90b5d855862d67010866f8afdb4db1ebe..72c31e30350d97e48e42ef7b3dabd6278a525fe8 100644 (file)
@@ -747,7 +747,7 @@ class depgraph(object):
                        myarg = None
                        if dep.root == self._frozen_config.target_root:
                                try:
-                                       myarg = self._iter_atoms_for_pkg(dep_pkg).next()
+                                       myarg = next(self._iter_atoms_for_pkg(dep_pkg))
                                except StopIteration:
                                        pass
                                except portage.exception.InvalidDependString:
@@ -1463,7 +1463,7 @@ class depgraph(object):
                                                installed_cp_set = non_virtual_cps
 
                                if len(expanded_atoms) > 1 and len(installed_cp_set) == 1:
-                                       installed_cp = iter(installed_cp_set).next()
+                                       installed_cp = next(iter(installed_cp_set))
                                        expanded_atoms = [atom for atom in expanded_atoms \
                                                if atom.cp == installed_cp]
 
@@ -2280,7 +2280,7 @@ class depgraph(object):
                                        myarg = None
                                        if root == self._frozen_config.target_root:
                                                try:
-                                                       myarg = self._iter_atoms_for_pkg(pkg).next()
+                                                       myarg = next(self._iter_atoms_for_pkg(pkg))
                                                except StopIteration:
                                                        pass
                                                except portage.exception.InvalidDependString:
@@ -4925,7 +4925,7 @@ class _dep_check_composite_db(portage.dbapi):
        def _visible(self, pkg):
                if pkg.installed and "selective" not in self._depgraph._dynamic_config.myparams:
                        try:
-                               arg = self._depgraph._iter_atoms_for_pkg(pkg).next()
+                               arg = next(self._depgraph._iter_atoms_for_pkg(pkg))
                        except (StopIteration, portage.exception.InvalidDependString):
                                arg = None
                        if arg:
index ddcfa8180b2a1227d8346d82ff0606c610be163a..b97207d68b249aec02998f336e3a4afd4853830b 100644 (file)
@@ -404,7 +404,7 @@ def unmerge(root_config, myopts, unmerge_action,
                        selected = d["selected"]
                        if not selected:
                                continue
-                       cp = portage.cpv_getkey(iter(selected).next())
+                       cp = portage.cpv_getkey(next(iter(selected)))
                        cp_dict = unordered.get(cp)
                        if cp_dict is None:
                                cp_dict = {}
@@ -423,7 +423,7 @@ def unmerge(root_config, myopts, unmerge_action,
                        if mytype == "selected":
                                continue
                        mylist.difference_update(all_selected)
-               cp = portage.cpv_getkey(iter(selected).next())
+               cp = portage.cpv_getkey(next(iter(selected)))
                for y in localtree.dep_match(cp):
                        if y not in pkgmap[x]["omitted"] and \
                                y not in pkgmap[x]["selected"] and \
index ed1b0426188c8430689b87f4d441998ba975ceb6..b777ed1d00af30bd197a85000ebf51bad0cc36fd 100644 (file)
@@ -105,7 +105,7 @@ class MutableMapping(Mapping):
 
        def popitem(self):
                try:
-                       k, v = iter(self.items()).next()
+                       k, v = next(iter(self.items()))
                except StopIteration:
                        raise KeyError('container is empty')
                del self[k]
@@ -442,7 +442,7 @@ def slot_dict_class(keys, prefix="_val_"):
 
                        def popitem(self):
                                try:
-                                       k, v = iter(self.items()).next()
+                                       k, v = next(iter(self.items()))
                                except StopIteration:
                                        raise KeyError('container is empty')
                                del self[k]
index 40557de155d8a1b6b58c37e8868b8c3662052fbf..e9bde27fb110d3dd2d257ca6bd8c37f041e9eaec 100644 (file)
@@ -970,7 +970,7 @@ class portdbapi(dbapi):
                        if mydep != mykey:
                                cpv_iter = self._iter_match(mydep, cpv_iter)
                        try:
-                               myval = cpv_iter.next()
+                               myval = next(cpv_iter)
                        except StopIteration:
                                myval = ""
 
index c8b9f6d44e16b56dcd94936a99210eae4ca5b476..97a613725a24bd58af2990b8519e9f57422c0e15 100644 (file)
@@ -153,7 +153,7 @@ class paren_normalize(list):
                for x in i:
                        if isinstance(x, basestring):
                                if x == '||':
-                                       x = self._zap_parens(i.next(), [], disjunction=True)
+                                       x = self._zap_parens(next(i), [], disjunction=True)
                                        if len(x) == 1:
                                                dest.append(x[0])
                                        else:
@@ -161,7 +161,7 @@ class paren_normalize(list):
                                                dest.append(x)
                                elif x.endswith("?"):
                                        dest.append(x)
-                                       dest.append(self._zap_parens(i.next(), []))
+                                       dest.append(self._zap_parens(next(i), []))
                                else:
                                        dest.append(x)
                        else: