[前][次][番号順一覧][スレッド一覧]

ruby-changes:37025

From: nobu <ko1@a...>
Date: Sat, 3 Jan 2015 04:03:31 +0900 (JST)
Subject: [ruby-changes:37025] nobu:r49106 (trunk): leakchecker.rb: for older IO.console

nobu	2015-01-03 04:03:17 +0900 (Sat, 03 Jan 2015)

  New Revision: 49106

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49106

  Log:
    leakchecker.rb: for older IO.console
    
    * test/lib/leakchecker.rb (check_fd_leak): do not call older
      version IO.console to get rid of ArgumentError, so that older
      versions can run to compare the resuls.

  Modified files:
    trunk/test/lib/leakchecker.rb
Index: test/lib/leakchecker.rb
===================================================================
--- test/lib/leakchecker.rb	(revision 49105)
+++ test/lib/leakchecker.rb	(revision 49106)
@@ -31,8 +31,8 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/test/lib/leakchecker.rb#L31
   def check_fd_leak(test_name)
     leaked = false
     live1 = @fd_info
-    if IO.respond_to?(:console)
-      IO.console(:close)
+    if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
+      m[:close]
     end
     live2 = find_fds
     fd_closed = live1 - live2

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]