From a98f1291df2a9d7a232e96f6b65369c03b5f8e12 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Tue, 5 May 2020 02:30:27 -0400 Subject: [PATCH] Move Zig source normalization to `create_files` This actually works, even if I don't know why. --- dmoj/executors/ZIG.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dmoj/executors/ZIG.py b/dmoj/executors/ZIG.py index 0dc5da4ae..d0fec3715 100644 --- a/dmoj/executors/ZIG.py +++ b/dmoj/executors/ZIG.py @@ -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 . + 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 [