mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Wrapped function can be registered as handler
This commit is contained in:
parent
2aa01b3c6f
commit
ddd92acc09
1 changed files with 2 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue