Use functools.wraps for check_resource decorator.

This helps runtime introspection tools like the `help()` builting or
IPython's `?` operator correctly find the underlying method instead of
the decorator definition.
This commit is contained in:
Scott Sanderson 2015-06-02 11:00:00 -04:00
parent be73aaf540
commit a7c15a8700
1 changed files with 3 additions and 0 deletions

View File

@ -1,7 +1,10 @@
from functools import wraps
from .. import errors
def check_resource(f):
@wraps(f)
def wrapped(self, resource_id=None, *args, **kwargs):
if resource_id is None:
if kwargs.get('container'):