From febf2cefb3b69dd859b3c81e0512d0bae9b315ea Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 26 Aug 2014 08:12:48 +0000 Subject: io.c: do not swallow exceptions at end of block * io.c (io_close): ignore only "closed stream" IOError and NoMethodError, do not swallow other exceptions at the end of block. [ruby-core:64463] [Bug #10153] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_io.rb') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 5ff07741dc..126100e096 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3065,4 +3065,13 @@ End assert_raise(RuntimeError) { t.join } } end + + def test_exception_at_close + bug10153 = '[ruby-core:64463] [Bug #10153] exception in close at the end of block' + assert_raise(Errno::EBADF, bug10153) do + IO.pipe do |r, w| + assert_nothing_raised {IO.open(w.fileno) {}} + end + end + end end -- cgit v1.2.3