From 6d72f3ecb7f305d25c301ee40b7d7dad88770907 Mon Sep 17 00:00:00 2001 From: Mateusz Masiarz Date: Mon, 5 Aug 2024 13:41:00 +0200 Subject: [PATCH] Another another fix --- src/sinol_make/executors/time.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sinol_make/executors/time.py b/src/sinol_make/executors/time.py index 7c573220..0744364c 100644 --- a/src/sinol_make/executors/time.py +++ b/src/sinol_make/executors/time.py @@ -80,7 +80,7 @@ def _parse_result(self, tle, mle, return_code, result_file_path) -> ExecutionRes lines = result_file.readlines() if len(lines) == 4 and lines[0].startswith("Command exited with non-zero status"): result.Status = Status.RE - exit_signal = abs(int(lines[0].strip()[len("Command exited with non-zero status "):])) + exit_signal = int(lines[0].strip()[len("Command exited with non-zero status "):]) program_exit_code = os.WTERMSIG(exit_signal) elif len(lines) == 3: """ @@ -99,12 +99,13 @@ def _parse_result(self, tle, mle, return_code, result_file_path) -> ExecutionRes For example: Command terminated by signal 11 """ - program_exit_code = abs(int(lines[0].strip().split(" ")[-1])) + program_exit_code = int(lines[0].strip().split(" ")[-1]) elif not mle: result.Status = Status.RE result.Error = "Unexpected output from time command:\n" + "".join(lines) result.Fail = True + program_exit_code = abs(program_exit_code) if program_exit_code is not None and program_exit_code != 0: result.Status = Status.RE result.Error = f"Solution exited with code {program_exit_code}"