ipykernel icon indicating copy to clipboard operation
ipykernel copied to clipboard

Cannot interrupt top-level coroutine

Open davidbrochart opened this issue 3 years ago • 1 comments

It looks like interrupting a cell execution which consists of awaiting a top-level coroutine, e.g.:

import asyncio

async def main():
    await asyncio.sleep(5)

await main()

doesn't take effect immediately, but once the coroutine completes execution.

See #880 for a test that reveals this bug.

davidbrochart avatar Mar 14 '22 18:03 davidbrochart

This also happens with:

import asyncio

await asyncio.sleep(5)

Which means that this test is incomplete.

davidbrochart avatar Jan 02 '23 15:01 davidbrochart