Specifically catch SyntaxError in modules/eval_python.py

This commit is contained in:
jesopo 2018-10-24 13:43:34 +01:00
parent 99f896ebdd
commit 7f9399a925

View file

@ -8,10 +8,9 @@ def fail(s):
old_stdout.write(json.dumps({"success": False, "out": str(e)}))
sys.exit()
try:
compiled = compile(sys.stdin.read(), "code", "single")
except Exception as e:
except SyntaxError as e:
self.fail(str(e))
old_stdout = sys.stdout