mirror of
https://github.com/micropython/micropython.git
synced 2026-01-13 07:27:16 +01:00
14 lines
349 B
Python
14 lines
349 B
Python
from ... import mod1
|
|
from ...mod2 import bar
|
|
|
|
print(mod1.foo)
|
|
print(bar)
|
|
|
|
# attempted relative import beyond top-level package
|
|
# On older versions of CPython (eg 3.8) this is a ValueError, but on
|
|
# newer CPython (eg 3.11) and MicroPython it's an ImportError.
|
|
try:
|
|
from .... import mod1
|
|
except (ImportError, ValueError):
|
|
print("ImportError")
|