hotfix run.py run
This commit is contained in:
7
run.py
7
run.py
@@ -644,12 +644,10 @@ def run(lang: str, testcase: tuple[str, ...], verbose: bool):
|
|||||||
f_in_path = f"{TC_DIR}/{tc}.in"
|
f_in_path = f"{TC_DIR}/{tc}.in"
|
||||||
f_out_path = f"{TC_DIR}/{tc}.out"
|
f_out_path = f"{TC_DIR}/{tc}.out"
|
||||||
|
|
||||||
with (
|
with open(f_out_path, "r", encoding="utf-8") as f_out:
|
||||||
open(f_in_path, "r", encoding="utf-8") as f_in,
|
|
||||||
open(f_out_path, "r", encoding="utf-8") as f_out,
|
|
||||||
):
|
|
||||||
expected = f_out.read().strip()
|
expected = f_out.read().strip()
|
||||||
|
|
||||||
|
f_in = open(f_in_path, "r", encoding="utf-8")
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
target_language.executable_command,
|
target_language.executable_command,
|
||||||
stdin=f_in,
|
stdin=f_in,
|
||||||
@@ -663,6 +661,7 @@ def run(lang: str, testcase: tuple[str, ...], verbose: bool):
|
|||||||
print(line, end="")
|
print(line, end="")
|
||||||
|
|
||||||
stdout, stderr = proc.communicate()
|
stdout, stderr = proc.communicate()
|
||||||
|
f_in.close()
|
||||||
|
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
click.secho(">>>>>> [RUN TIME ERROR] >>>>>>", fg="red", bold=True)
|
click.secho(">>>>>> [RUN TIME ERROR] >>>>>>", fg="red", bold=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user