ruby-changes:10559
From: akr <ko1@a...>
Date: Sun, 8 Feb 2009 09:10:21 +0900 (JST)
Subject: [ruby-changes:10559] Ruby:r22114 (trunk): specify exception class for rescue clause.
akr 2009-02-08 09:10:13 +0900 (Sun, 08 Feb 2009) New Revision: 22114 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22114 Log: specify exception class for rescue clause. Modified files: trunk/test/ruby/test_process.rb Index: test/ruby/test_process.rb =================================================================== --- test/ruby/test_process.rb (revision 22113) +++ test/ruby/test_process.rb (revision 22114) @@ -111,13 +111,21 @@ s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) Process.setrlimit(:NOFILE, max-10) - Process.setrlimit(:NOFILE, :INFINITY) rescue exit 1 + begin + Process.setrlimit(:NOFILE, :INFINITY) + rescue Errno::EPERM + exit 1 + end End assert_not_equal(0, s.exitstatus) s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) Process.setrlimit(:NOFILE, max-10) - Process.setrlimit(:NOFILE, "INFINITY") rescue exit 1 + begin + Process.setrlimit(:NOFILE, "INFINITY") + rescue Errno::EPERM + exit 1 + end End assert_not_equal(0, s.exitstatus) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/