mirror of
https://github.com/django/django.git
synced 2025-11-24 04:47:12 +00:00
Normalized decorator style for functools.wraps.
This commit is contained in:
parent
aff649a3bd
commit
8cf4de206c
4 changed files with 12 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue