From ac0c66355b4ea4790f1d07b97e04752e027881ac Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 28 May 2019 14:23:54 +0000 Subject: [PATCH] Bug 1547730 - Do six.itervalues instead of dict.itervalues r=glandium Differential Revision: https://phabricator.services.mozilla.com/D28104 --HG-- extra : moz-landing-system : lando --- python/mozbuild/mozbuild/configure/__init__.py | 2 +- python/mozbuild/mozbuild/configure/options.py | 2 +- python/mozbuild/mozpack/mozjar.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py index 37f30659b138..794ab2ca1a7b 100644 --- a/python/mozbuild/mozbuild/configure/__init__.py +++ b/python/mozbuild/mozbuild/configure/__init__.py @@ -435,7 +435,7 @@ class ConfigureSandbox(dict): if path: self.include_file(path) - for option in self._options.itervalues(): + for option in six.itervalues(self._options): # All options must be referenced by some @depends function if option not in self._seen: raise ConfigureError( diff --git a/python/mozbuild/mozbuild/configure/options.py b/python/mozbuild/mozbuild/configure/options.py index 59938653196c..126628a30298 100644 --- a/python/mozbuild/mozbuild/configure/options.py +++ b/python/mozbuild/mozbuild/configure/options.py @@ -519,5 +519,5 @@ class CommandLineHelper(object): def __iter__(self): for d in (self._args, self._extra_args): - for arg, pos in d.itervalues(): + for arg, pos in six.itervalues(d): yield arg diff --git a/python/mozbuild/mozpack/mozjar.py b/python/mozbuild/mozpack/mozjar.py index 8a2e28f10045..7d8e9c9d26a1 100644 --- a/python/mozbuild/mozpack/mozjar.py +++ b/python/mozbuild/mozpack/mozjar.py @@ -75,7 +75,7 @@ class JarStruct(object): an instance with empty fields. ''' assert self.MAGIC and isinstance(self.STRUCT, OrderedDict) - self.size_fields = set(t for t in self.STRUCT.itervalues() + self.size_fields = set(t for t in six.itervalues(self.STRUCT) if t not in JarStruct.TYPE_MAPPING) self._values = {} if data: @@ -381,7 +381,7 @@ class JarReader(object): entries = self.entries if not entries: return JAR_STORED - return max(f['compression'] for f in entries.itervalues()) + return max(f['compression'] for f in six.itervalues(entries)) @property def entries(self): @@ -459,7 +459,7 @@ class JarReader(object): for file in jarReader: ... ''' - for entry in self.entries.itervalues(): + for entry in six.itervalues(self.entries): yield self._getreader(entry) def __getitem__(self, name): @@ -553,7 +553,7 @@ class JarWriter(object): headers = {} preload_size = 0 # Prepare central directory entries - for entry, content in self._contents.itervalues(): + for entry, content in six.itervalues(self._contents): header = JarLocalFileHeader() for name in entry.STRUCT: if name in header: @@ -576,18 +576,18 @@ class JarWriter(object): offset = end['cdir_size'] + end['cdir_offset'] + end.size preload_size += offset self._data.write(struct.pack('