Skip to content

Commit

Permalink
fix: reduce unclosed IO warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 5, 2024
1 parent 4caa00b commit 324319d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plumbum/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ def popen(self, args=(), **kwargs):
dstproc = self.dstcmd.popen(**kwargs)
# allow p1 to receive a SIGPIPE if p2 exits
srcproc.stdout.close()
if srcproc.stderr:
srcproc.stderr.close()
if srcproc.stdin and src_kwargs.get("stdin") != PIPE:
srcproc.stdin.close()
dstproc.srcproc = srcproc
Expand Down

0 comments on commit 324319d

Please sign in to comment.