Resolve decorated callbacks in spec filter

This commit is contained in:
Alex Root Junior 2018-10-24 22:39:34 +03:00
parent e0a832f5ba
commit 42913389c0

View file

@ -14,6 +14,9 @@ class CancelHandler(Exception):
def _check_spec(func: callable, kwargs: dict):
while hasattr(func, '__wrapped__'): # Try to resolve decorated callbacks
func = func.__wrapped__
spec = inspect.getfullargspec(func)
if spec.varkw:
return kwargs