Bug Fix

The Ignored Coroutine

The Ignored Coroutine

Bug Report

An async function wraps a risky async call inside a try/except block. But when the call fails, the except block never runs, and Python warns about a coroutine that was never awaited.

async/awaitError Handlingasyncio
Fix the Bug: The Ignored Coroutine

Calling an async function without 'await' does NOT run it — it just creates a coroutine object that sits there unexecuted. The exception inside it never actually gets raised, so try/except has nothing to catch, and Python prints a 'coroutine was never awaited' warning.

EditorPython · JSX
PreviewUpdates on Run Tests
Loading preview…
Tests
Must use 'await' before risky_task()
Should keep the try/except structure
Should NOT call risky_task() without await