From a7c15a8700ab6404a207840993e968d86c1b613c Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Tue, 2 Jun 2015 11:00:00 -0400 Subject: [PATCH] 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. --- docker/utils/decorators.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/utils/decorators.py b/docker/utils/decorators.py index 4771da21..7ffcce1e 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'):