blob: b46efcae271c9ccc6c25845e371df1a30d1dc038 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# make sure syntax error works correctly for bad const definition
def test_syntax(code):
try:
exec(code)
except SyntaxError:
print("SyntaxError")
# argument not a constant
test_syntax("a = const(x)")
# redefined constant
test_syntax("A = const(1); A = const(2)")
|