diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-01 10:56:39 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-01 10:56:39 +0000 |
commit | 14ad015896fb58e7ce2ddb9d829789327ca159d7 (patch) | |
tree | 053496d4268d18da8345a81c81cabf58e995a6e0 /lib/open3.rb | |
parent | 44f58afa751e98ec9fe5b89a5a5e71ca474e99cf (diff) |
* lib/open3.rb (Open3.capture3): Ignore Errno::EPIPE for writing
stdin_data.
(Open3.capture2): Ditto.
(Open3.capture2e): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open3.rb')
-rw-r--r-- | lib/open3.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/open3.rb b/lib/open3.rb index a54e1b3886..7595265a93 100644 --- a/lib/open3.rb +++ b/lib/open3.rb @@ -257,7 +257,10 @@ module Open3 end out_reader = Thread.new { o.read } err_reader = Thread.new { e.read } - i.write stdin_data + begin + i.write stdin_data + rescue Errno::EPIPE + end i.close [out_reader.value, err_reader.value, t.value] } @@ -300,7 +303,10 @@ module Open3 o.binmode end out_reader = Thread.new { o.read } - i.write stdin_data + begin + i.write stdin_data + rescue Errno::EPIPE + end i.close [out_reader.value, t.value] } @@ -330,7 +336,10 @@ module Open3 oe.binmode end outerr_reader = Thread.new { oe.read } - i.write stdin_data + begin + i.write stdin_data + rescue Errno::EPIPE + end i.close [outerr_reader.value, t.value] } |