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 f2(*args, **kwargs):
mydelay = delay
tries = range(max_tries)
tries.reverse()
tries = reversed(range(max_tries))
for tries_remaining in tries:
try:
return func(*args, **kwargs)