mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-28 10:38:26 +00:00
19 lines
477 B
Python
19 lines
477 B
Python
|
import functools
|
||
|
|
||
|
|
||
|
try:
|
||
|
from decorator import decorator
|
||
|
except ImportError:
|
||
|
def decorator(caller):
|
||
|
""" Turns caller into a decorator.
|
||
|
Unlike decorator module, function signature is not preserved.
|
||
|
|
||
|
:param caller: caller(f, *args, **kwargs)
|
||
|
"""
|
||
|
def decor(f):
|
||
|
@functools.wraps(f)
|
||
|
def wrapper(*args, **kwargs):
|
||
|
return caller(f, *args, **kwargs)
|
||
|
return wrapper
|
||
|
return decor
|