ruby-changes:54955
From: ko1 <ko1@a...>
Date: Sun, 3 Mar 2019 15:18:48 +0900 (JST)
Subject: [ruby-changes:54955] ko1:r67161 (trunk): do not close FSs explicitly.
ko1 2019-03-03 15:18:43 +0900 (Sun, 03 Mar 2019) New Revision: 67161 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67161 Log: do not close FSs explicitly. * test/ruby/test_dir.rb: r67159 closes all files explicitly but this change breaks attempt of this test introduced at r56467. Try another solution which removes all references from an Array with `#clear`. Modified files: trunk/test/ruby/test_dir.rb Index: test/ruby/test_dir.rb =================================================================== --- test/ruby/test_dir.rb (revision 67160) +++ test/ruby/test_dir.rb (revision 67161) @@ -458,10 +458,10 @@ class TestDir < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir.rb#L458 Process.setrlimit(Process::RLIMIT_NOFILE, 50) begin fs = [] - tap {tap {tap {(0..100).map {fs << open(IO::NULL)}}}} + tap {tap {tap {(0..100).each {fs << open(IO::NULL)}}}} rescue Errno::EMFILE ensure - fs.each{|f| f.close} + fs.clear end list = Dir.glob("*").sort assert_not_empty(list) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/