#2643·brython

aio.gather() raises RuntimeWarnings with standard use

Author: cwag-ghCreated Nov 29, 2025Updated Jul 9, 2026

When using aio.gather() in what (I believe) is the canonical way (#1174):

python
from browser import aio

async def coro1():
    await aio.sleep(0.1)
    print('Coro 1')
    
async def coro2():
    await aio.sleep(0.2)
    print('Coro 2')

async def main():
    await aio.gather(coro1(), coro2())
    print('all done')
  
aio.run(main())

I get the following output in the online editor:

VFS._aio.py:14: RuntimeWarning: coroutine 'undefined' was never awaited
    return _task()
VFS._aio.py:14: RuntimeWarning: coroutine 'undefined' was never awaited
    return _task()
Coro 1
Coro 2
all done

I've tried saving the coroutines as variables to test if it was a scope issue, but that didn't seem to help.