cog
a780e5ef - fix: await async def setup() coroutine instead of silently dropping it (#2921)

Commit
2 days ago
fix: await async def setup() coroutine instead of silently dropping it (#2921) When a predictor has async def setup(), call_method0("setup") returns a coroutine object. The ? operator only checks for Python exceptions, so the coroutine was silently dropped -- setup appeared to succeed but none of the setup code actually executed. Detect whether setup() is async during load() (matching predict/train), and run the coroutine with asyncio.run() when it is. Fixes #2919
Author
Parents
Loading