diff --git a/utilities/execution_engines/python_execution_engine.py b/utilities/execution_engines/python_execution_engine.py index 546b6fd2..778238fb 100644 --- a/utilities/execution_engines/python_execution_engine.py +++ b/utilities/execution_engines/python_execution_engine.py @@ -70,7 +70,10 @@ def execute_python(code, client, message_id, build_file=True): return error_json # The child process was successful. - output_json = {"output": output.decode("utf8"), "execution_time": execution_time} + if output: + output_json = {"output": output.decode("utf8"), "execution_time": execution_time} + else: + output_json = {"output": "", "execution_time": execution_time} return output_json return spawn_process(code)