Skip to content

Commit

Permalink
Move Zig source normalization to create_files
Browse files Browse the repository at this point in the history
This actually works, even if I don't know why.
  • Loading branch information
Xyene authored May 5, 2020
1 parent 56fad33 commit a98f129
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dmoj/executors/ZIG.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class Executor(CompiledExecutor):
}
}'''

def __init__(self, problem_id, source_code, **kwargs):
# this clean needs to happen because zig refuses to compile carriage returns
# https://github.com/ziglang/zig/issues/544
code = source_code.replace(b'\r\n', b'\r').replace(b'\r', b'\n')
super().__init__(problem_id, code, **kwargs)
def create_files(self, problem_id, source_code, *args, **kwargs):
# This cleanup needs to happen because Zig refuses to compile carriage returns.
# See <https://github.com/ziglang/zig/issues/544>.
source_code = source_code.replace(b'\r\n', b'\r').replace(b'\r', b'\n')
super().create_files(problem_id, source_code, *args, **kwargs)

def get_compile_args(self):
return [
Expand Down

0 comments on commit a98f129

Please sign in to comment.