Skip to content

Commit

Permalink
fix(client): force to close popen stdout for log_check_call (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianweidut authored Jul 21, 2022
1 parent eddd42c commit 30c50bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/starwhale/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def log_check_call(*args: t.Any, **kwargs: t.Any) -> int:

p.wait()

try:
p.stdout.close() # type: ignore
except Exception as ex:
log(f"failed to close stdout:{ex}")

if p.returncode != 0:
cmd = kwargs.get("args") or args[0]
e = CalledProcessError(p.returncode, cmd)
Expand Down

0 comments on commit 30c50bd

Please sign in to comment.