The following
import uasyncio as asyncio
async def bar():
await asyncio.sleep(1)
print('In bar')
async def foo():
print('Launching bar')
await bar()
print('Getting it wrong')
bar() # bad
loop = asyncio.get_event_loop()
loop.run_until_complete(foo())
produces this output
>>> import rats37
Launching bar
In bar
Getting it wrong
>>>
CPython 3.5.2 issues the following error message:
>>> import rats37
Launching bar
In bar
Getting it wrong
/home/adminpete/rats37.py:11: RuntimeWarning: coroutine 'bar' was never awaited
bar()
>>>
It would be useful if a message were emitted in response to this error.
The following
produces this output
CPython 3.5.2 issues the following error message:
It would be useful if a message were emitted in response to this error.