mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 17:10:24 +08:00
22 lines
261 B
Python
22 lines
261 B
Python
# test compile builtin
|
|
|
|
try:
|
|
compile
|
|
except NameError:
|
|
print("SKIP")
|
|
import sys
|
|
sys.exit()
|
|
|
|
c = compile("print(x)", "file", "exec")
|
|
|
|
try:
|
|
exec(c)
|
|
except NameError:
|
|
print("NameError")
|
|
|
|
x = 1
|
|
exec(c)
|
|
|
|
exec(c, {"x":2})
|
|
exec(c, {}, {"x":3})
|