From 8f0ec6cead8f072c031fff1c076af350b4fe9343 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Wed, 6 May 2026 18:11:19 +0900 Subject: [PATCH] hotfix run.py run --- run.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index dfb831b..e5ea4a4 100755 --- a/run.py +++ b/run.py @@ -644,12 +644,10 @@ def run(lang: str, testcase: tuple[str, ...], verbose: bool): f_in_path = f"{TC_DIR}/{tc}.in" f_out_path = f"{TC_DIR}/{tc}.out" - with ( - open(f_in_path, "r", encoding="utf-8") as f_in, - open(f_out_path, "r", encoding="utf-8") as f_out, - ): + with open(f_out_path, "r", encoding="utf-8") as f_out: expected = f_out.read().strip() + f_in = open(f_in_path, "r", encoding="utf-8") proc = subprocess.Popen( target_language.executable_command, stdin=f_in, @@ -663,6 +661,7 @@ def run(lang: str, testcase: tuple[str, ...], verbose: bool): print(line, end="") stdout, stderr = proc.communicate() + f_in.close() if proc.returncode != 0: click.secho(">>>>>> [RUN TIME ERROR] >>>>>>", fg="red", bold=True)