mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user