Commit b2f19b8d authored by Damien George's avatar Damien George
Browse files

tests: Get builtin_compile to skin properly on pyboard.

parent 480a7ce5
# test compile builtin
try:
compile
except NameError:
print("SKIP")
import sys
sys.exit()
def have_compile():
try:
compile
return True
except NameError:
return False
# global variable for compiled code to access
x = 1
c = compile("print(x)", "file", "exec")
def test():
c = compile("print(x)", "file", "exec")
try:
exec(c)
except NameError:
print("NameError")
try:
exec(c)
except NameError:
print("NameError")
x = 1
exec(c)
exec(c, {"x":2})
exec(c, {}, {"x":3})
exec(c, {"x":2})
exec(c, {}, {"x":3})
if have_compile():
test()
else:
print("SKIP")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment