(Distilled from #10329)
This program causes a hard safe-mode crash:
import asyncio
async def f():
pass
async def g():
while True:
asyncio.run(f())
await asyncio.sleep(10) # necessary
asyncio.run(g())
g() needs to have a loop and an asyncio.sleep() in it to exercise the bug.
In CPython, running the same code raises an error:
RuntimeError: asyncio.run() cannot be called from a running event loop
<sys>:0: RuntimeWarning: coroutine 'f' was never awaited
This is the same as micropython#15187.
(Distilled from #10329)
This program causes a hard safe-mode crash:
g()needs to have a loop and anasyncio.sleep()in it to exercise the bug.In CPython, running the same code raises an error:
This is the same as micropython#15187.