From 27c3f0499633620153280679fa75a8a02cbf1369 Mon Sep 17 00:00:00 2001 From: XYCode Kerman Date: Wed, 10 Apr 2024 14:01:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(judge):=20=E6=B5=8B=E8=AF=95=E7=82=B9?= =?UTF-8?q?=E7=9A=84CRLF=E5=92=8CLF=E4=B8=8D=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: https://github.com/XYCode-Kerman/ItsWA/issues/8 --- ccf_parser/problems.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ccf_parser/problems.py b/ccf_parser/problems.py index 002735e..32a066e 100644 --- a/ccf_parser/problems.py +++ b/ccf_parser/problems.py @@ -18,6 +18,10 @@ class CheckPoint(BaseModel): output_file: Optional[pathlib.Path] = None def compare(self, output: str) -> bool: + # CRLF转换到LF + self.answer = self.answer.replace('\r\n', '\n') + output = output.replace('\r\n', '\n') + return self.answer.strip() == output.strip()