xrange() -> range()

This commit is contained in:
Lex Berezhny 2018-07-21 16:43:32 -04:00 committed by Jack Robison
parent 005a131440
commit 24a872885a
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 4 additions and 4 deletions

View file

@ -101,7 +101,7 @@ class FullStreamProgressManager(StreamProgressManager):
if not blobs: if not blobs:
return 0 return 0
else: else:
for i in xrange(max(blobs.iterkeys())): for i in range(max(blobs.iterkeys())):
if self._done(i, blobs): if self._done(i, blobs):
return i return i
return max(blobs.iterkeys()) + 1 return max(blobs.iterkeys()) + 1

View file

@ -81,7 +81,7 @@ class TestReflector(unittest.TestCase):
return d return d
def create_stream(): def create_stream():
test_file = mocks.GenFile(5209343, b''.join([chr(i + 3) for i in xrange(0, 64, 6)])) test_file = mocks.GenFile(5209343, b''.join([chr(i + 3) for i in range(0, 64, 6)]))
d = EncryptedFileCreator.create_lbry_file( d = EncryptedFileCreator.create_lbry_file(
self.client_blob_manager, self.client_storage, prm, self.client_lbry_file_manager, self.client_blob_manager, self.client_storage, prm, self.client_lbry_file_manager,
"test_file", "test_file",

View file

@ -81,7 +81,7 @@ class TestStreamify(TestCase):
yield "%016d" % iv yield "%016d" % iv
def create_stream(): def create_stream():
test_file = GenFile(5209343, b''.join([chr(i + 3) for i in xrange(0, 64, 6)])) test_file = GenFile(5209343, b''.join([chr(i + 3) for i in range(0, 64, 6)]))
d = create_lbry_file( d = create_lbry_file(
self.blob_manager, self.storage, self.prm, self.lbry_file_manager, "test_file", test_file, self.blob_manager, self.storage, self.prm, self.lbry_file_manager, "test_file", test_file,
key="0123456701234567", iv_generator=iv_generator() key="0123456701234567", iv_generator=iv_generator()
@ -95,7 +95,7 @@ class TestStreamify(TestCase):
@defer.inlineCallbacks @defer.inlineCallbacks
def test_create_and_combine_stream(self): def test_create_and_combine_stream(self):
test_file = GenFile(53209343, b''.join([chr(i + 5) for i in xrange(0, 64, 6)])) test_file = GenFile(53209343, b''.join([chr(i + 5) for i in range(0, 64, 6)]))
lbry_file = yield create_lbry_file(self.blob_manager, self.storage, self.prm, self.lbry_file_manager, lbry_file = yield create_lbry_file(self.blob_manager, self.storage, self.prm, self.lbry_file_manager,
"test_file", test_file) "test_file", test_file)
sd_hash = yield self.storage.get_sd_blob_hash_for_stream(lbry_file.stream_hash) sd_hash = yield self.storage.get_sd_blob_hash_for_stream(lbry_file.stream_hash)