Skip to content

Commit

Permalink
use new asyncio.all_tasks if available (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas authored May 15, 2019
1 parent 7670fd5 commit 7dad6d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion colcon_core/executor/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ def execute(self, args, jobs, *, on_error=OnError.interrupt): # noqa: D102
del jobs[pending_name]

finally:
for task in asyncio.Task.all_tasks():
try:
# new in Python 3.7
all_tasks = asyncio.all_tasks
except AttributeError:
all_tasks = asyncio.Task.all_tasks
for task in all_tasks():
if not task.done():
logger.error("Task '{task}' not done".format_map(locals()))
# HACK on Windows closing the event loop seems to hang after Ctrl-C
Expand Down

0 comments on commit 7dad6d7

Please sign in to comment.