Project

General

Profile

Actions

Bug #9380

closed

Enumerator does not work in timeout

Added by nobu (Nobuyoshi Nakada) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Target version:
[ruby-dev:47872]

Description

Enumeratortimeoutの組み合わせで、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'
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0