Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
tianweidut committed Oct 17, 2022
1 parent 7fcda3a commit e3fa875
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/starwhale/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ def log_check_call(*args: t.Any, **kwargs: t.Any) -> int:
p = Popen(*args, **kwargs)
logger.debug(f"cmd: {p.args!r}")

def _print_log() -> None:
while True:
line = p.stdout.readline() # type: ignore
if line:
log(line.rstrip())
output.append(line)

while True:
_print_log()
if p.poll() is not None:
break

p.wait()
_print_log()
for line in p.stdout.readlines(): # type: ignore
if line:
log(line.rstrip())
output.append(line)

try:
p.stdout.close() # type: ignore
Expand Down

0 comments on commit e3fa875

Please sign in to comment.