Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion retrying.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def wrap(f):

@six.wraps(f)
def wrapped_f(*args, **kw):
return Retrying(*dargs, **dkw).call(f, *args, **kw)
# if dargs contains more than one argument,
# check first one is an integer, then assign it to 'stop_max_attempt_number'
if len(dargs) >= 1 and isinstance(dargs[0], int):
dkw['stop_max_attempt_number'] = dargs[0]
return Retrying(**dkw).call(f, *args, **kw)

return wrapped_f

Expand Down