diff --git a/typer/main.py b/typer/main.py index a685149e1f..9d9ef012e0 100644 --- a/typer/main.py +++ b/typer/main.py @@ -240,7 +240,7 @@ def command( cls = TyperCommand def decorator(f: CommandFunctionType) -> CommandFunctionType: - def add_runner(f: CommandFunctionType) -> CommandFunctionType: + def add_runner(f: CommandFunctionType) -> CommandFunctionType: #type: ignore @wraps(f) def run_wrapper(*args, **kwargs) -> Any: if sys.version_info >= (3, 11) and self.loop_factory: @@ -249,9 +249,9 @@ def run_wrapper(*args, **kwargs) -> Any: elif sys.version_info >= (3, 7): return asyncio.run(f(*args, **kwargs)) else: - asyncio.get_event_loop().run_until_complete(asyncio.wait(f(*args, **kwargs))) + asyncio.get_event_loop().run_until_complete(f(*args, **kwargs)) - return run_wrapper + return run_wrapper #type: ignore if inspect.iscoroutinefunction(f): callback = add_runner(f)