From ddd92acc09067b383ea22bf850326afe0371cf47 Mon Sep 17 00:00:00 2001 From: birdi Date: Mon, 29 Jul 2019 21:59:32 +0300 Subject: [PATCH] Wrapped function can be registered as handler --- aiogram/dispatcher/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiogram/dispatcher/handler.py b/aiogram/dispatcher/handler.py index 17b715d1..2a77d580 100644 --- a/aiogram/dispatcher/handler.py +++ b/aiogram/dispatcher/handler.py @@ -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):