Bug 1547730 - Use six.moves.xrange() instead of xrange() r=#build
☠☠ backed out by ee4b88439111 ☠ ☠
authorJustin Wood <Callek@gmail.com>
Mon, 15 Apr 2019 14:50:56 -0400
changeset 474146 3df74540bde34a0514c2b98bab05152d2b1cffed
parent 474145 1891cfbb55d1570132882c3adda6ad8d80e08cc4
child 474147 3037f5bf1019d1eb730e31857e1a8d4d4216eadb
push id36023
push userncsoregi@mozilla.com
push dateThu, 16 May 2019 21:56:43 +0000
treeherdermozilla-central@786f094a30ae [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.xrange() instead of xrange() r=#build Differential Revision: https://phabricator.services.mozilla.com/D28106
python/mozbuild/mozpack/mozjar.py
python/mozbuild/mozpack/test/test_files.py
--- a/python/mozbuild/mozpack/mozjar.py
+++ b/python/mozbuild/mozpack/mozjar.py
@@ -392,17 +392,17 @@ class JarReader(object):
         '''
         if hasattr(self, '_entries'):
             return self._entries
         preload = 0
         if self.is_optimized:
             preload = JarStruct.get_data('uint32', self._data)[0]
         entries = OrderedDict()
         offset = self._cdir_end['cdir_offset']
-        for e in xrange(self._cdir_end['cdir_entries']):
+        for e in six.moves.xrange(self._cdir_end['cdir_entries']):
             entry = JarCdirEntry(self._data[offset:])
             offset += entry.size
             # Creator host system. 0 is MSDOS, 3 is Unix
             host = entry['creator_version'] >> 8
             # External attributes values depend on host above. On Unix the
             # higher bits are the stat.st_mode value. On MSDOS, the lower bits
             # are the FAT attributes.
             xattr = entry['external_attr']
--- a/python/mozbuild/mozpack/test/test_files.py
+++ b/python/mozbuild/mozpack/test/test_files.py
@@ -160,17 +160,17 @@ class TestDest(TestWithTmpDir):
         dest.write('foo')
         dest.close()
         dest.write('qux')
         self.assertEqual(dest.read(), 'qux')
 
 
 rand = b''.join(random.choice(
     b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
-                for i in xrange(131597))
+                for i in six.moves.xrange(131597))
 samples = [
     b'',
     b'test',
     b'fooo',
     b'same',
     b'same',
     b'Different and longer',
     rand,
@@ -710,17 +710,17 @@ class TestDeflatedFile(TestWithTmpDir):
         src = self.tmppath('src.jar')
         dest = self.tmppath('dest')
 
         contents = {}
         with JarWriter(src) as jar:
             for content in samples:
                 name = b''.join(random.choice(
                     b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
-                    for i in xrange(8))
+                    for i in range(8))
                 jar.add(name, content, compress=True)
                 contents[name] = content
 
         for j in JarReader(src):
             f = DeflatedFile(j)
             f.copy(dest)
             self.assertEqual(contents[j.filename], open(dest, 'rb').read())