Skip to content

Commit

Permalink
#88: Fix the mypy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
borissmidt committed Jul 6, 2023
1 parent 85159fb commit af67b42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions typer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit af67b42

Please sign in to comment.