summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Sanderson <scoutoss@gmail.com>2015-06-02 11:00:00 -0400
committerScott Sanderson <scoutoss@gmail.com>2015-06-02 11:00:00 -0400
commita7c15a8700ab6404a207840993e968d86c1b613c (patch)
tree316b4656e90020ced0feaf1ce160fbfc8bb6aa56
parentbe73aaf5401faf5ca64911fb6664036c7b7ec61b (diff)
downloaddocker-py-a7c15a8700ab6404a207840993e968d86c1b613c.tar.gz
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.
-rw-r--r--docker/utils/decorators.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/docker/utils/decorators.py b/docker/utils/decorators.py
index 4771da2..7ffcce1 100644
--- a/docker/utils/decorators.py
+++ b/docker/utils/decorators.py
@@ -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'):