修复一处逻辑错误

This commit is contained in:
virusdefender 2016-10-07 11:20:09 +08:00
parent d3dedfbc87
commit 10b229970a
2 changed files with 9 additions and 9 deletions

View File

@ -37,12 +37,12 @@ class Compiler(object):
gid=LOW_PRIVILEDGE_GID)
if result["result"] != _judger.RESULT_SUCCESS:
with open(compiler_out) as f:
error = f.read().strip()
os.remove(compiler_out)
if error:
raise CompileError(error)
raise CompileError("Compiler runtime error, info: %s" % json.dumps(result).decode("utf-8"))
os.remove(compiler_out)
try:
with open(compiler_out) as f:
error = f.read().strip()
os.remove(compiler_out)
if error:
raise CompileError(error)
except Exception:
raise CompileError("Compiler runtime error, info: %s" % json.dumps(result).decode("utf-8"))
return exe_path

View File

@ -127,7 +127,7 @@ class JudgeClient(object):
run_result["result"] = _judger.RESULT_WRONG_ANSWER
elif spj_result == SPJ_ERROR:
run_result["result"] = _judger.RESULT_SYSTEM_ERROR
run_result["error"] = _judger.RESULT_SPJ_ERROR
run_result["error"] = -11
else:
run_result["output_md5"], is_ac = self._compare_output(test_case_file_id)
# -1 == Wrong Answer