Normalized decorator style for functools.wraps.

This commit is contained in:
Aymeric Augustin 2022-05-22 08:26:21 +02:00 committed by Mariusz Felisiak
parent aff649a3bd
commit 8cf4de206c
4 changed files with 12 additions and 6 deletions

View file

@ -159,10 +159,11 @@ class DecoratorsTest(TestCase):
# For testing method_decorator, a decorator that assumes a single argument.
# We will get type arguments if there is a mismatch in the number of arguments.
def simple_dec(func):
@wraps(func)
def wrapper(arg):
return func("test:" + arg)
return wraps(func)(wrapper)
return wrapper
simple_dec_m = method_decorator(simple_dec)