Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: build/download_utils.py

Issue 6880339: Small cosmetic change - simplify retry logic (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/http_download.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/download_utils.py
===================================================================
--- build/download_utils.py (revision 5079)
+++ build/download_utils.py (working copy)
@@ -118,13 +118,18 @@
def Retry(op, *args):
if sys.platform in ('win32', 'cygwin'):
- for i in range(5):
+ for i in xrange(5):
+ if i:
+ sys.stdout.write("RETRY: %s %s\n" % (op.__name__, repr(args)))
+ time.sleep(pow(2, i))
try:
op(*args)
break
except Exception:
- sys.stdout.write("RETRY: %s %s\n" % (op.__name__, repr(args)))
- time.sleep(pow(2, i))
+ pass
+ else
+ sys.stdout.write("FAILED: %s %s\n" % (op.__name__, repr(args)))
+ raise
else:
op(*args)
« no previous file with comments | « no previous file | build/http_download.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698