diff options
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/__init__.py | 16 | ||||
-rw-r--r-- | pym/portage/dbapi/__init__.py | 3 | ||||
-rw-r--r-- | pym/portage/dbapi/bintree.py | 6 | ||||
-rw-r--r-- | pym/portage/dbapi/porttree.py | 7 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 3 | ||||
-rw-r--r-- | pym/portage/tests/env/config/test_PortageModulesFile.py | 3 |
6 files changed, 17 insertions, 21 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index f0cc471e9..f85ae0c61 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -35,7 +35,7 @@ try: from commands import getstatusoutput as subprocess_getstatusoutput from time import sleep from random import shuffle - from itertools import chain, izip + from itertools import chain import platform import warnings @@ -2586,7 +2586,7 @@ class config(object): pkg_configdict.addLazySingleton(k, mydb.__getitem__, k) else: - for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)): + for k, v in zip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)): pkg_configdict[k] = v repository = pkg_configdict.pop("repository", None) if repository is not None: @@ -6653,7 +6653,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, fd_pipes=fd_pipes, returnpid=True, droppriv=droppriv) os.close(pw) # belongs exclusively to the child process now f = os.fdopen(pr, 'rb') - for k, v in izip(auxdbkeys, + for k, v in zip(auxdbkeys, (_unicode_decode(line).rstrip('\n') for line in f)): dbkey[k] = v f.close() @@ -7136,7 +7136,7 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi): misc_keys = ["LICENSE", "PROPERTIES", "PROVIDE", "RESTRICT", "SRC_URI"] other_keys = ["SLOT"] all_keys = dep_keys + misc_keys + other_keys - metadata = dict(izip(all_keys, + metadata = dict(zip(all_keys, mydbapi.aux_get(mysettings.mycpv, all_keys))) class FakeTree(object): @@ -7690,7 +7690,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): if unreduced[0] != "||": unresolved = [] - for x, satisfied in izip(unreduced, reduced): + for x, satisfied in zip(unreduced, reduced): if isinstance(x, list): unresolved += dep_zapdeps(x, satisfied, myroot, use_binaries=use_binaries, trees=trees) @@ -7732,7 +7732,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): # Sort the deps into installed, not installed but already # in the graph and other, not installed and not in the graph # and other, with values of [[required_atom], availablility] - for x, satisfied in izip(deps, satisfieds): + for x, satisfied in zip(deps, satisfieds): if isinstance(x, list): atoms = dep_zapdeps(x, satisfied, myroot, use_binaries=use_binaries, trees=trees) @@ -8174,7 +8174,7 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo if metadata is None: db_keys = list(portdb._aux_cache_keys) try: - metadata = dict(izip(db_keys, portdb.aux_get(mycpv, db_keys))) + metadata = dict(zip(db_keys, portdb.aux_get(mycpv, db_keys))) except KeyError: if not portdb.cpv_exists(mycpv): raise @@ -8250,7 +8250,7 @@ def getmaskingstatus(mycpv, settings=None, portdb=None): if metadata is None: db_keys = list(portdb._aux_cache_keys) try: - metadata = dict(izip(db_keys, portdb.aux_get(mycpv, db_keys))) + metadata = dict(zip(db_keys, portdb.aux_get(mycpv, db_keys))) except KeyError: if not portdb.cpv_exists(mycpv): raise diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index ebcd785a0..c904d5d2c 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -221,14 +221,13 @@ class dbapi(object): aux_get = self.aux_get aux_update = self.aux_update update_keys = ["DEPEND", "RDEPEND", "PDEPEND", "PROVIDE"] - from itertools import izip from portage.update import update_dbentries if onUpdate: onUpdate(maxval, 0) if onProgress: onProgress(maxval, 0) for i, cpv in enumerate(cpv_all): - metadata = dict(izip(update_keys, aux_get(cpv, update_keys))) + metadata = dict(zip(update_keys, aux_get(cpv, update_keys))) metadata_updates = update_dbentries(updates, metadata) if metadata_updates: aux_update(cpv, metadata_updates) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index bc91152a6..9473798e1 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -29,7 +29,7 @@ import codecs import errno import re import stat -from itertools import chain, izip +from itertools import chain class bindbapi(fakedbapi): _known_keys = frozenset(list(fakedbapi._known_keys) + \ @@ -610,7 +610,7 @@ class binarytree(object): d["MTIME"] = str(long(s.st_mtime)) d["SIZE"] = str(s.st_size) - d.update(izip(self._pkgindex_aux_keys, + d.update(zip(self._pkgindex_aux_keys, self.dbapi.aux_get(mycpv, self._pkgindex_aux_keys))) try: self._eval_use_flags(mycpv, d) @@ -933,7 +933,7 @@ class binarytree(object): pkg_path = self.getname(cpv) from portage.checksum import perform_multiple_checksums - d = dict(izip(self._pkgindex_aux_keys, + d = dict(zip(self._pkgindex_aux_keys, self.dbapi.aux_get(cpv, self._pkgindex_aux_keys))) d.update(perform_multiple_checksums( diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index b46abb2cc..ea22abd11 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -35,7 +35,6 @@ from portage import _unicode_encode import codecs import logging import stat -from itertools import izip def _src_uri_validate(cpv, eapi, src_uri): """ @@ -988,7 +987,7 @@ class portdbapi(dbapi): iterfunc = reversed for cpv in iterfunc(mylist): try: - metadata = dict(izip(aux_keys, + metadata = dict(zip(aux_keys, self.aux_get(cpv, aux_keys))) except KeyError: # ebuild masked by corruption @@ -1070,7 +1069,7 @@ class portdbapi(dbapi): getProfileMaskAtom = self.mysettings._getProfileMaskAtom for cpv in mylist: try: - metadata = dict(izip(db_keys, self.aux_get(cpv, db_keys))) + metadata = dict(zip(db_keys, self.aux_get(cpv, db_keys))) except KeyError: # masked by corruption continue @@ -1097,7 +1096,7 @@ class portdbapi(dbapi): for mycpv in mylist: metadata.clear() try: - metadata.update(izip(aux_keys, self.aux_get(mycpv, aux_keys))) + metadata.update(zip(aux_keys, self.aux_get(mycpv, aux_keys))) except KeyError: continue except PortageException as e: diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 74d12c99a..31bde127a 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -51,7 +51,6 @@ import codecs import re, shutil, stat, errno, copy, subprocess import logging import sys -from itertools import izip try: import cPickle as pickle @@ -1231,7 +1230,7 @@ class vardbapi(dbapi): if pull_me: # pull any needed data and cache it aux_keys = list(pull_me) - for k, v in izip(aux_keys, + for k, v in zip(aux_keys, self._aux_get(mycpv, aux_keys, st=mydir_stat)): mydata[k] = v if not cache_valid or cache_these.difference(metadata): diff --git a/pym/portage/tests/env/config/test_PortageModulesFile.py b/pym/portage/tests/env/config/test_PortageModulesFile.py index 40472104b..41a44c4cc 100644 --- a/pym/portage/tests/env/config/test_PortageModulesFile.py +++ b/pym/portage/tests/env/config/test_PortageModulesFile.py @@ -6,7 +6,6 @@ from portage import os from portage.tests import TestCase from portage.env.config import PortageModulesFile from tempfile import mkstemp -from itertools import izip class PortageModulesFileTestCase(TestCase): @@ -16,7 +15,7 @@ class PortageModulesFileTestCase(TestCase): def setUp(self): self.items = {} - for k, v in izip(self.keys + self.invalid_keys, + for k, v in zip(self.keys + self.invalid_keys, self.modules): self.items[k] = v |