Merge pull request #21 from harlowja/wraps

Ensure we wrap the decorated functions
This commit is contained in:
Ray Holder 2014-11-09 20:43:07 -06:00
commit 8fd859896a
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,8 @@ def retry(*dargs, **dkw):
# support both @retry and @retry() as valid syntax
if len(dargs) == 1 and callable(dargs[0]):
def wrap_simple(f):
@six.wraps(f)
def wrapped_f(*args, **kw):
return Retrying().call(f, *args, **kw)
@ -64,6 +66,8 @@ def retry(*dargs, **dkw):
else:
def wrap(f):
@six.wraps(f)
def wrapped_f(*args, **kw):
return Retrying(*dargs, **dkw).call(f, *args, **kw)