mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
14 lines
328 B
Python
14 lines
328 B
Python
|
# test errors with import *
|
||
|
|
||
|
# 'import *' is not allowed in function scope
|
||
|
try:
|
||
|
exec("def foo(): from x import *")
|
||
|
except SyntaxError as er:
|
||
|
print("function", "SyntaxError")
|
||
|
|
||
|
# 'import *' is not allowed in class scope
|
||
|
try:
|
||
|
exec("class C: from x import *")
|
||
|
except SyntaxError as er:
|
||
|
print("class", "SyntaxError")
|