Fixing retries.py so that it works in py3

This commit is contained in:
Val Markovic 2016-02-28 16:35:38 -08:00
parent ba6c6182ed
commit d340ed5dc8

View File

@ -61,8 +61,7 @@ def retries(max_tries, delay=1, backoff=2, exceptions=(Exception,), hook=None):
def dec(func): def dec(func):
def f2(*args, **kwargs): def f2(*args, **kwargs):
mydelay = delay mydelay = delay
tries = range(max_tries) tries = reversed(range(max_tries))
tries.reverse()
for tries_remaining in tries: for tries_remaining in tries:
try: try:
return func(*args, **kwargs) return func(*args, **kwargs)