Skip to content

Commit

Permalink
Fix versionadded and versionchanged decorator: do not return …
Browse files Browse the repository at this point in the history
…a decorator factory, but a Wrapt adapter (close #48).
  • Loading branch information
tantale committed Sep 5, 2021
1 parent aaca116 commit 5f051bf
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions deprecated/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,7 @@ def versionadded(reason="", version="", line_length=70):
version=version,
line_length=line_length,
)

# noinspection PyUnusedLocal
@wrapt.decorator(adapter=adapter)
def wrapper(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)

return wrapper
return adapter


def versionchanged(reason="", version="", line_length=70):
Expand Down Expand Up @@ -218,13 +212,7 @@ def versionchanged(reason="", version="", line_length=70):
version=version,
line_length=line_length,
)

# noinspection PyUnusedLocal
@wrapt.decorator(adapter=adapter)
def wrapper(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)

return wrapper
return adapter


def deprecated(reason="", version="", line_length=70, **kwargs):
Expand Down

0 comments on commit 5f051bf

Please sign in to comment.