Wrapped function can be registered as handler

This commit is contained in:
birdi 2019-07-29 21:59:32 +03:00
parent 2aa01b3c6f
commit ddd92acc09

View file

@ -23,11 +23,11 @@ class CancelHandler(Exception):
def _get_spec(func: callable):
wrapped_function = func
while hasattr(func, '__wrapped__'): # Try to resolve decorated callbacks
func = func.__wrapped__
spec = inspect.getfullargspec(func)
return spec, func
return spec, wrapped_function
def _check_spec(spec: inspect.FullArgSpec, kwargs: dict):