mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use functools.wraps with decorators
Otherwise, we're not fully wrapping the function so expected attributes (at least __opts__ anyway) go missing. Fixes #44639
This commit is contained in:
parent
5ae263cf1c
commit
1670b5d647
1 changed files with 2 additions and 0 deletions
|
@ -413,6 +413,7 @@ class _IsDeprecated(_DeprecationDecorator):
|
|||
'''
|
||||
_DeprecationDecorator.__call__(self, function)
|
||||
|
||||
@wraps(function)
|
||||
def _decorate(*args, **kwargs):
|
||||
'''
|
||||
Decorator function.
|
||||
|
@ -587,6 +588,7 @@ class _WithDeprecated(_DeprecationDecorator):
|
|||
'''
|
||||
_DeprecationDecorator.__call__(self, function)
|
||||
|
||||
@wraps(function)
|
||||
def _decorate(*args, **kwargs):
|
||||
'''
|
||||
Decorator function.
|
||||
|
|
Loading…
Add table
Reference in a new issue