diff options
| author | 2018-10-24 13:43:34 +0100 | |
|---|---|---|
| committer | 2018-10-24 13:43:34 +0100 | |
| commit | 7f9399a925a743aa088354b45323dd207304e208 (patch) | |
| tree | 0a5f5f495913f26ee4a0c4382b5633e1e89d6744 /modules/eval_python.py | |
| parent | Catch syntax errors with .py/.py2 (diff) | |
| signature | ||
Specifically catch SyntaxError in modules/eval_python.py
Diffstat (limited to 'modules/eval_python.py')
| -rw-r--r-- | modules/eval_python.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/eval_python.py b/modules/eval_python.py index 1a9fb306..d514edfd 100644 --- a/modules/eval_python.py +++ b/modules/eval_python.py @@ -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 |
