Bug 1547730 - Use six.moves.reduce for reduce() r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D28109

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Justin Wood 2019-05-28 14:28:18 +00:00
Родитель c5571e7a5c
Коммит 241fd2ab7d
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -718,7 +718,7 @@ class Preprocessor:
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')

Просмотреть файл

@ -567,8 +567,8 @@ class JarWriter(object):
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: