From f6b62d001a7ee868a745054d2e6146167570e682 Mon Sep 17 00:00:00 2001 From: Cosmic Oppai Date: Tue, 19 Nov 2024 01:56:21 +0530 Subject: [ruby/timeout] removed the non numeric check https://github.com/ruby/timeout/commit/7d2af46a00 Co-authored-by: Jeremy Evans --- lib/timeout.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/timeout.rb b/lib/timeout.rb index 4ba07e7c5c..e403eee931 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -165,8 +165,8 @@ module Timeout # Timeout into your classes so they have a #timeout method, as well as # a module method, so you can call it directly as Timeout.timeout(). def timeout(sec, klass = nil, message = nil, &block) #:yield: +sec+ - raise ArgumentError, "Timeout sec must be a non-negative number" if sec && !(sec.is_a?(Numeric) && sec >= 0) return yield(sec) if sec == nil or sec.zero? + raise ArgumentError, "Timeout sec must be a non-negative number" if 0 > sec message ||= "execution expired" -- cgit v1.2.3