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:
Wayne Werner 2019-04-18 08:49:40 -04:00 committed by Pedro Algarvio
parent 5ae263cf1c
commit 1670b5d647
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -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.