From 961c191394c750466fd3181fafaf3173b7fcc38f Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 21 Jul 2025 18:18:40 -0500 Subject: [PATCH] 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. --- colcon_parallel_executor/executor/parallel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/colcon_parallel_executor/executor/parallel.py b/colcon_parallel_executor/executor/parallel.py index da7c902..061cb56 100644 --- a/colcon_parallel_executor/executor/parallel.py +++ b/colcon_parallel_executor/executor/parallel.py @@ -5,6 +5,7 @@ from concurrent.futures import ALL_COMPLETED from concurrent.futures import FIRST_COMPLETED from contextlib import suppress +from inspect import iscoroutinefunction import logging import os import signal @@ -150,7 +151,7 @@ async def _execute(self, args, jobs, *, on_error): # pass them to the executor for package_name, job in take_jobs: - assert asyncio.iscoroutinefunction(job.__call__), \ + assert iscoroutinefunction(job.__call__), \ 'Job is not a coroutine' future = asyncio.ensure_future(job()) futures[future] = job