summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-16 23:44:24 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-17 00:52:29 +0900
commite231f8e8a8659bab7f8ef9992c6b36b8683fb8aa (patch)
treed45649cdfe010e7fb2984d75cdd5ec7ef571aab2 /tool
parentfedc8075fe2a2bbbfa12c028c0879330d7db5596 (diff)
envutil.rb: not try to close pipes twice
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3039
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/envutil.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb
index 2faf48385e..07d76c0e53 100644
--- a/tool/lib/envutil.rb
+++ b/tool/lib/envutil.rb
@@ -137,8 +137,10 @@ module EnvUtil
args = [args] if args.kind_of?(String)
pid = spawn(child_env, *precommand, rubybin, *args, **opt)
in_c.close
- out_c.close if capture_stdout
- err_c.close if capture_stderr && capture_stderr != :merge_to_stdout
+ out_c&.close
+ out_c = nil
+ err_c&.close
+ err_c = nil
if block_given?
return yield in_p, out_p, err_p, pid
else