mirror of
https://github.com/W3SLAV/micropython.git
synced 2025-06-19 12:05:32 -04:00

And use `asyncio.new_event_loop()` where possible. This change is needed because CPython 3.12 deprecated the `get_event_loop()` function. Signed-off-by: Damien George <damien@micropython.org>
19 lines
330 B
Python
19 lines
330 B
Python
# Test get_event_loop()
|
|
# Note: CPython deprecated get_event_loop() so this test needs a .exp
|
|
|
|
try:
|
|
import asyncio
|
|
except ImportError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
|
|
async def main():
|
|
print("start")
|
|
await asyncio.sleep(0.01)
|
|
print("end")
|
|
|
|
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(main())
|