py: Make compiler return a proper exception on SyntaxError.

This commit is contained in:
Damien George
2014-10-05 19:01:34 +01:00
parent 6dba992182
commit a91ac2011f
10 changed files with 53 additions and 37 deletions

View File

@@ -0,0 +1,6 @@
# test if eval raises SyntaxError
try:
print(eval("[1, *a]"))
except SyntaxError:
print("SyntaxError")