diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 07:55:26 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 07:55:26 +0000 |
commit | ccef579aee4ab784e1a46ea755d2717224f628c2 (patch) | |
tree | 5ac33ab5e44445bdade899e1d12db29ca8c9d900 /lib | |
parent | 9580200f7da99a5d1e2c3b35354b4972d1be9ea5 (diff) |
merge revision(s) 51213: [Backport #11344]
* lib/timeout.rb (ExitException): removed internal exception class
and use Timeout::Error instead, as using throw/catch to isolate
each timeouts now. [ruby-dev:49179] [Bug #11344]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/timeout.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb index d805dce2a3..5fce1f09a5 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -24,8 +24,6 @@ module Timeout # Raised by Timeout#timeout when the block times out. class Error < RuntimeError - end - class ExitException < ::Exception # :nodoc: attr_reader :thread def self.catch(*args) @@ -48,6 +46,7 @@ module Timeout self end end + ExitException = Error # :stopdoc: THIS_FILE = /\A#{Regexp.quote(__FILE__)}:/o @@ -103,7 +102,7 @@ module Timeout bt = e.backtrace end else - bt = ExitException.catch(message, &bl) + bt = Error.catch(message, &bl) end rej = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-4}\z/o bt.reject! {|m| rej =~ m} |