Skip to content

Commit a7c15a8

Browse files
committed
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.
1 parent be73aaf commit a7c15a8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docker/utils/decorators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
from functools import wraps
12
from .. import errors
23

34

45
def check_resource(f):
6+
7+
@wraps(f)
58
def wrapped(self, resource_id=None, *args, **kwargs):
69
if resource_id is None:
710
if kwargs.get('container'):

0 commit comments

Comments
 (0)