Specifically catch SyntaxError in modules/eval_python.py
This commit is contained in:
parent
99f896ebdd
commit
7f9399a925
1 changed files with 1 additions and 2 deletions
|
@ -8,10 +8,9 @@ def fail(s):
|
||||||
old_stdout.write(json.dumps({"success": False, "out": str(e)}))
|
old_stdout.write(json.dumps({"success": False, "out": str(e)}))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
compiled = compile(sys.stdin.read(), "code", "single")
|
compiled = compile(sys.stdin.read(), "code", "single")
|
||||||
except Exception as e:
|
except SyntaxError as e:
|
||||||
self.fail(str(e))
|
self.fail(str(e))
|
||||||
|
|
||||||
old_stdout = sys.stdout
|
old_stdout = sys.stdout
|
||||||
|
|
Loading…
Reference in a new issue