Skip to content

Commit 6b924f7

Browse files
authored
Switch iscoroutinefunction from asyncio to inspect (#39)
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 6b924f7

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)