Skip to content

Commit

Permalink
mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erdewit committed Apr 27, 2021
1 parent f0d4e53 commit ddf8823
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ib_insync/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,10 @@ def run(*awaitables: Awaitable, timeout: float = None):
return
loop.run_forever()
result = None
all_tasks = (
asyncio.all_tasks(loop) # type: ignore
if sys.version_info >= (3, 7) else asyncio.Task.all_tasks())
if sys.version_info >= (3, 7):
all_tasks = asyncio.all_tasks(loop) # type: ignore
else:
all_tasks = asyncio.Task.all_tasks() # type: ignore
if all_tasks:
# cancel pending tasks
f = asyncio.gather(*all_tasks)
Expand Down

0 comments on commit ddf8823

Please sign in to comment.