Bug 1547730 - Use six.moves.reduce for reduce() r=#build
☠☠ backed out by ee4b88439111 ☠ ☠
authorJustin Wood <Callek@gmail.com>
Mon, 15 Apr 2019 20:39:47 -0400
changeset 533013 03bdcaab1623f0b867ba989663b31477f74b6d60
parent 533012 6c9f98dacbde5f8bd5a810e17ca3013812e814f2
child 533014 75879e53727cca39ce05eb638b60a8516c5eb029
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1547730
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547730 - Use six.moves.reduce for reduce() r=#build Differential Revision: https://phabricator.services.mozilla.com/D28109
python/mozbuild/mozbuild/preprocessor.py
python/mozbuild/mozpack/mozjar.py
--- a/python/mozbuild/mozbuild/preprocessor.py
+++ b/python/mozbuild/mozbuild/preprocessor.py
@@ -713,17 +713,17 @@ class Preprocessor:
 
         def vsubst(v):
             if v in self.context:
                 return str(self.context[v])
             return ''
         for i in range(1, len(lst), 2):
             lst[i] = vsubst(lst[i])
         lst.append('\n')  # add back the newline
-        self.write(reduce(lambda x, y: x+y, lst, ''))
+        self.write(six.moves.reduce(lambda x, y: x+y, lst, ''))
 
     def do_literal(self, args):
         self.write(args + '\n')
 
     def do_filter(self, args):
         filters = [f for f in args.split(' ') if hasattr(self, 'filter_' + f)]
         if len(filters) == 0:
             return
--- a/python/mozbuild/mozpack/mozjar.py
+++ b/python/mozbuild/mozpack/mozjar.py
@@ -562,18 +562,18 @@ class JarWriter(object):
             offset += len(content) + header.size
             if entry['filename'] == self._last_preloaded:
                 preload_size = offset
             headers[entry] = header
         # Prepare end of central directory
         end = JarCdirEnd()
         end['disk_entries'] = len(self._contents)
         end['cdir_entries'] = end['disk_entries']
-        end['cdir_size'] = reduce(lambda x, y: x + y[0].size,
-                                  self._contents.values(), 0)
+        end['cdir_size'] = six.moves.reduce(lambda x, y: x + y[0].size,
+                                            self._contents.values(), 0)
         # On optimized archives, store the preloaded size and the central
         # directory entries, followed by the first end of central directory.
         if preload_size:
             end['cdir_offset'] = 4
             offset = end['cdir_size'] + end['cdir_offset'] + end.size
             preload_size += offset
             self._data.write(struct.pack('<I', preload_size))
             for entry, _ in six.itervalues(self._contents):