summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-11 03:45:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-11 03:45:54 +0000
commita2b889f4ab6162bb3abee745b0eaa28ee8802829 (patch)
tree76f7df3fe4941a0ce818dc2f44eec4ee7b8efd11
parent0d70cc5ce7bae793b851871e56ab3bb5b6bf7f2c (diff)
timeout.rb: fix backtrace
* lib/timeout.rb (Timeout#timeout): remove regexp with wrong line nuber and fix caller depth. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/timeout.rb4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 25b057c..a77b2ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 11 12:45:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* lib/timeout.rb (ExitException): removed internal exception class
diff --git a/lib/timeout.rb b/lib/timeout.rb
index b57a113..db52a6f 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -101,9 +101,7 @@ module Timeout
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