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>
diff --git a/download_from_google_storage.py b/download_from_google_storage.py
index afd1803..5f7b71b 100755
--- a/download_from_google_storage.py
+++ b/download_from_google_storage.py
@@ -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 @@
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