Skip to content

Commit

Permalink
Unify the way to wrap the function
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Feb 25, 2020
1 parent 82ceb4c commit f7e6626
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/aiotools/defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def defer(f: Callable) -> None:
f = deferreds.pop()
f()

_wrapped.__wrapped__ = func
return _wrapped


Expand All @@ -93,6 +92,7 @@ def adefer(func):
assert inspect.iscoroutinefunction(func), \
'the decorated function must be async'

@functools.wraps(func)
async def _wrapped(*args, **kwargs):
deferreds = deque()

Expand All @@ -111,5 +111,4 @@ def defer(f: Union[Callable, Awaitable]) -> None:
else:
f()

_wrapped.__wrapped__ = func
return _wrapped

0 comments on commit f7e6626

Please sign in to comment.