From d2d49282f55544886a38a577d6692c0d7349115c Mon Sep 17 00:00:00 2001 From: birdi Date: Tue, 30 Jul 2019 12:25:42 +0300 Subject: [PATCH] make handler._get_spec return only specs --- aiogram/dispatcher/handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aiogram/dispatcher/handler.py b/aiogram/dispatcher/handler.py index 2a77d580..889dc8d6 100644 --- a/aiogram/dispatcher/handler.py +++ b/aiogram/dispatcher/handler.py @@ -23,11 +23,10 @@ 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, wrapped_function + return spec def _check_spec(spec: inspect.FullArgSpec, kwargs: dict): @@ -56,7 +55,7 @@ class Handler: :param filters: list of filters :param index: you can reorder handlers """ - spec, handler = _get_spec(handler) + spec = _get_spec(handler) if filters and not isinstance(filters, (list, tuple, set)): filters = [filters]