diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-21 18:14:01 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-21 18:14:01 +0000 |
commit | 35b1511e59fceccff009fcae92fce3152bee1feb (patch) | |
tree | 9eef6112edfddb94c4df11eadceab3d28a3f5040 | |
parent | d8cd294a4cd4d984f4119d712718b62fab7c1b14 (diff) | |
download | portage-35b1511e59fceccff009fcae92fce3152bee1feb.tar.gz portage-35b1511e59fceccff009fcae92fce3152bee1feb.tar.bz2 portage-35b1511e59fceccff009fcae92fce3152bee1feb.zip |
Use next(iterator) instead of iterator.next() for compatibility with Python 3.
(2to3-3.1 -f next -nw ${FILES})
svn path=/main/trunk/; revision=14355
-rw-r--r-- | pym/_emerge/BlockerDB.py | 2 | ||||
-rw-r--r-- | pym/_emerge/MetadataRegen.py | 2 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 8 | ||||
-rw-r--r-- | pym/_emerge/unmerge.py | 4 | ||||
-rw-r--r-- | pym/portage/cache/mappings.py | 4 | ||||
-rw-r--r-- | pym/portage/dbapi/porttree.py | 2 | ||||
-rw-r--r-- | pym/portage/dep.py | 4 |
7 files changed, 13 insertions, 13 deletions
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py index 1c4af1cae..8367ec651 100644 --- a/pym/_emerge/BlockerDB.py +++ b/pym/_emerge/BlockerDB.py @@ -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) diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py index 88b157fd0..6bfd722c2 100644 --- a/pym/_emerge/MetadataRegen.py +++ b/pym/_emerge/MetadataRegen.py @@ -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 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index d20016c90..72c31e303 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -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: diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index ddcfa8180..b97207d68 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -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 \ diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py index ed1b04261..b777ed1d0 100644 --- a/pym/portage/cache/mappings.py +++ b/pym/portage/cache/mappings.py @@ -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] diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 40557de15..e9bde27fb 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -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 = "" diff --git a/pym/portage/dep.py b/pym/portage/dep.py index c8b9f6d44..97a613725 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -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: |