Move taking a reference to sys.stdout above fail() in modules/eval_python.py
This commit is contained in:
parent
46179d2f38
commit
f89b96f373
1 changed files with 1 additions and 1 deletions
|
@ -4,6 +4,7 @@ from src import ModuleManager, utils
|
|||
EVAL_TEMPLATE = """
|
||||
import io, json, sys
|
||||
|
||||
old_stdout = sys.stdout
|
||||
def fail(s):
|
||||
old_stdout.write(json.dumps({"success": False, "out": str(e)}))
|
||||
sys.exit()
|
||||
|
@ -13,7 +14,6 @@ try:
|
|||
except SyntaxError as e:
|
||||
fail(str(e))
|
||||
|
||||
old_stdout = sys.stdout
|
||||
stdout = io.StringIO()
|
||||
sys.stdout = stdout
|
||||
|
||||
|
|
Loading…
Reference in a new issue