From 69cebafad27665fa2b0118d2fb8e3c29a123612d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=89=AC?= Date: Thu, 18 Oct 2018 10:33:05 +0800 Subject: [PATCH] Fix java compile error --- server/server.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/server.py b/server/server.py index b2f3190..a07b30f 100644 --- a/server/server.py +++ b/server/server.py @@ -76,8 +76,13 @@ class JudgeServer: exe_path = Compiler().compile(compile_config=compile_config, src_path=src_path, output_dir=submission_dir) - os.chown(exe_path, RUN_USER_UID, 0) - os.chmod(exe_path, 0o500) + try: + # Java exe_path is SOME_PATH/Main, but the real path is SOME_PATH/Main.class + # We ignore it temporarily + os.chown(exe_path, RUN_USER_UID, 0) + os.chmod(exe_path, 0o500) + except Exception: + pass else: exe_path = os.path.join(submission_dir, run_config["exe_name"]) with open(exe_path, "w", encoding="utf-8") as f: