circuitpython/tests/extmod/asyncio_as_uasyncio.py
Jim Mussared ca79b49619 extmod/asyncio/uasyncio.py: Add backwards-compatible uasyncio alias.
This allows existing code that does `import uasyncio` or
`import uasyncio as asyncio` to continue working.

It uses the same lazy-loading as asyncio to prevent loading of unused
features.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-19 18:37:34 +10:00

13 lines
220 B
Python

try:
import uasyncio
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
x = set(dir(uasyncio))
y = set(dir(asyncio)) - set(["event", "lock", "stream", "funcs"])
print(x - y)
print(y - x)