Project

General

Profile

Bug #9380

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

=begin 
 (({Enumerator}))と(({timeout}))の組み合わせで、(({Timeout::Error}))が起きるべきところで(({ArgumentError}))が発生します。 Enumeratorとtimeoutの組み合わせで、Timeout::Errorが起きるべきところでArgumentErrorが発生します。 

  $ ruby -v -rtimeout -e 'def (o=Object.new).each; sleep; end' -e 'Timeout.timeout(0.01) {o.to_enum.next}' 
  ruby 2.2.0dev (2014-01-07 trunk 44522) [universal.x86_64-darwin13.0] 
  /opt/local/lib/ruby/2.2.0/timeout.rb:39:in `throw': uncaught throw #<Timeout::ExitException: Timeout::ExitException> (ArgumentError) 
 	 from /opt/local/lib/ruby/2.2.0/timeout.rb:39:in `exception' 
 	 from -e:1:in `sleep' 
 	 from -e:1:in `each' 
 	 from -e:1:in `each' 
 =end 

Back