diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/timeout.rb | 4 |
2 files changed, 6 insertions, 3 deletions
@@ -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 b57a11384f..db52a6fde5 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 |