mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
make handler._get_spec return only specs
This commit is contained in:
parent
ddd92acc09
commit
d2d49282f5
1 changed files with 2 additions and 3 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue