2016-12-21 11:25:53 +11:00
|
|
|
from ... import mod1
|
|
|
|
from ...mod2 import bar
|
|
|
|
print(mod1.foo)
|
|
|
|
print(bar)
|
2017-01-16 15:45:55 +11:00
|
|
|
|
|
|
|
# when attempting relative import beyond top-level package uPy raises ImportError
|
|
|
|
# whereas CPython raises a ValueError
|
|
|
|
try:
|
|
|
|
from .... import mod1
|
2017-01-16 16:21:04 +11:00
|
|
|
except ValueError:
|
|
|
|
print('ValueError')
|