mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-15 03:54:24 +01:00
Fix typing of @coroutine decorator
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
import functools
|
||||
from bdb import BdbQuit
|
||||
from typing import Callable, ParamSpec, TypeVar
|
||||
from typing import Any, Callable, Coroutine, ParamSpec, TypeVar
|
||||
|
||||
import click
|
||||
|
||||
@@ -53,9 +53,9 @@ def handle_exceptions(
|
||||
return wrapped
|
||||
|
||||
|
||||
def coroutine(f):
|
||||
def coroutine(f: Callable[P, Coroutine[Any, Any, T]]) -> Callable[P, T]:
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args, **kwargs):
|
||||
def wrapper(*args: P.args, **kwargs: P.kwargs):
|
||||
return asyncio.run(f(*args, **kwargs))
|
||||
|
||||
return wrapper
|
||||
|
||||
Reference in New Issue
Block a user