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 <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Nov 1, 2023
1 parent fe7752f commit e748f92
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 @@ -398,6 +398,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 e748f92

Please sign in to comment.