mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
0d70cc5ce7
commit
a2b889f4ab
2 changed files with 6 additions and 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>
|
Fri Jul 10 22:05:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/timeout.rb (ExitException): removed internal exception class
|
* lib/timeout.rb (ExitException): removed internal exception class
|
||||||
|
|
|
@ -101,9 +101,7 @@ module Timeout
|
||||||
else
|
else
|
||||||
bt = Error.catch(message, &bl)
|
bt = Error.catch(message, &bl)
|
||||||
end
|
end
|
||||||
rej = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-4}\z/o
|
level = -caller(CALLER_OFFSET).size-2
|
||||||
bt.reject! {|m| rej =~ m}
|
|
||||||
level = -caller(CALLER_OFFSET).size
|
|
||||||
while THIS_FILE =~ bt[level]
|
while THIS_FILE =~ bt[level]
|
||||||
bt.delete_at(level)
|
bt.delete_at(level)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue