Fix: colab stdout error, so replace with stdout wrapper

This commit is contained in:
litagin02
2023-12-30 09:58:32 +09:00
parent f1441c35f2
commit 35a8bb514f
9 changed files with 20 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ import subprocess
import sys
from .log import logger
from .stdout_wrapper import get_stdout
python = sys.executable
@@ -10,7 +11,7 @@ def run_script_with_log(cmd: list[str]) -> tuple[bool, str]:
logger.info(f"Running: {' '.join(cmd)}")
result = subprocess.run(
[python] + cmd,
stdout=sys.stdout,
stdout=get_stdout(), # type: ignore
stderr=subprocess.PIPE,
text=True,
)