Commit ceb64a4f authored by Eli Ribble's avatar Eli Ribble Committed by LUCI CQ

Improve Python-3 compatibility of download_from_google_storage.py

xrange doesn't exist in Python 3 and only nominally improves
memory usage on a value as small as MAX_TRIES.

Change-Id: I1e7408a05de880fee293466b1548c7f35e926270
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2246611
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
parent d9399925
......@@ -2,7 +2,6 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Download files from Google Storage based on SHA1 sums."""
from __future__ import print_function
......@@ -130,7 +129,7 @@ class Gsutil(object):
def check_call_with_retries(self, *args):
delay = self.RETRY_BASE_DELAY
for i in xrange(self.MAX_TRIES):
for i in range(self.MAX_TRIES):
code, out, err = self.check_call(*args)
if not code or i == self.MAX_TRIES - 1:
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment