Skip to content

Commit

Permalink
fix: Make duties unwrappable
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Apr 5, 2021
1 parent 5df5b95 commit c96325a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/duty/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ def create_duty(
aliases.add(name)
name = dash_name
description = inspect.getdoc(func) or ""
return Duty(name, description, func, aliases=aliases, pre=pre, post=post, opts=opts)
duty = Duty(name, description, func, aliases=aliases, pre=pre, post=post, opts=opts)
duty.__name__ = name # type: ignore
duty.__doc__ = description
duty.__wrapped__ = func # type: ignore # noqa: WPS609
return duty


def duty(*args, **kwargs) -> Union[Callable, Duty]:
Expand Down

0 comments on commit c96325a

Please sign in to comment.