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

ruby-changes:39135

From: nobu <ko1@a...>
Date: Sat, 11 Jul 2015 12:46:10 +0900 (JST)
Subject: [ruby-changes:39135] nobu:r51216 (trunk): timeout.rb: fix backtrace

nobu	2015-07-11 12:45:54 +0900 (Sat, 11 Jul 2015)

  New Revision: 51216

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

  Log:
    timeout.rb: fix backtrace
    
    * lib/timeout.rb (Timeout#timeout): remove regexp with wrong line
      nuber and fix caller depth.

  Modified files:
    trunk/ChangeLog
    trunk/lib/timeout.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51215)
+++ ChangeLog	(revision 51216)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jul 11 12:45:51 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/timeout.rb (Timeout#timeout): remove regexp with wrong line
+	  nuber and fix caller depth.
+
 Fri Jul 10 22:05:50 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/timeout.rb (ExitException): removed internal exception class
Index: lib/timeout.rb
===================================================================
--- lib/timeout.rb	(revision 51215)
+++ lib/timeout.rb	(revision 51216)
@@ -101,9 +101,7 @@ module Timeout https://github.com/ruby/ruby/blob/trunk/lib/timeout.rb#L101
     else
       bt = Error.catch(message, &bl)
     end
-    rej = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-4}\z/o
-    bt.reject! {|m| rej =~ m}
-    level = -caller(CALLER_OFFSET).size
+    level = -caller(CALLER_OFFSET).size-2
     while THIS_FILE =~ bt[level]
       bt.delete_at(level)
     end

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

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