mirror of https://github.com/docker/docker-py.git
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:
parent
be73aaf540
commit
a7c15a8700
|
|
@ -1,7 +1,10 @@
|
||||||
|
from functools import wraps
|
||||||
from .. import errors
|
from .. import errors
|
||||||
|
|
||||||
|
|
||||||
def check_resource(f):
|
def check_resource(f):
|
||||||
|
|
||||||
|
@wraps(f)
|
||||||
def wrapped(self, resource_id=None, *args, **kwargs):
|
def wrapped(self, resource_id=None, *args, **kwargs):
|
||||||
if resource_id is None:
|
if resource_id is None:
|
||||||
if kwargs.get('container'):
|
if kwargs.get('container'):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue