Skip to content

Commit

Permalink
Another another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Aug 5, 2024
1 parent e802886 commit 6d72f3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sinol_make/executors/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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}"
Expand Down

0 comments on commit 6d72f3e

Please sign in to comment.