Skip to content

Commit 961c191

Browse files
committed
Switch iscoroutinefunction from asyncio to inspect
The inspect.iscoroutinefunction function was added in Python 3.5, and the asyncio.iscoroutinefunction function was removed in Python 3.14.
1 parent 2eca2ea commit 961c191

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

colcon_parallel_executor/executor/parallel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from concurrent.futures import ALL_COMPLETED
66
from concurrent.futures import FIRST_COMPLETED
77
from contextlib import suppress
8+
from inspect import iscoroutinefunction
89
import logging
910
import os
1011
import signal
@@ -150,7 +151,7 @@ async def _execute(self, args, jobs, *, on_error):
150151

151152
# pass them to the executor
152153
for package_name, job in take_jobs:
153-
assert asyncio.iscoroutinefunction(job.__call__), \
154+
assert iscoroutinefunction(job.__call__), \
154155
'Job is not a coroutine'
155156
future = asyncio.ensure_future(job())
156157
futures[future] = job

0 commit comments

Comments
 (0)