From 40270906824a981652719c5e614c2cf4d1c234b0 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 10 Aug 2015 17:08:37 +0000 Subject: 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] * lib/timeout.rb (ExitException): leave Timeout::ExitException as an alias of Timeout::Error for backward compatibility in stable branch. [ruby-dev:49179] [Bug #11344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/timeout.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/timeout.rb') diff --git a/lib/timeout.rb b/lib/timeout.rb index fec7b9428c..123f600ccb 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) @@ -46,6 +44,7 @@ module Timeout self end end + ExitException = Error # :stopdoc: THIS_FILE = /\A#{Regexp.quote(__FILE__)}:/o @@ -101,7 +100,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} -- cgit v1.2.3