Skip to content

Commit f6b62d0

Browse files
Cosmicoppaijeremyevans
authored andcommitted
[ruby/timeout] removed the non numeric check
ruby/timeout@7d2af46a00 Co-authored-by: Jeremy Evans <[email protected]>
1 parent 7dc7aab commit f6b62d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/timeout.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ def self.ensure_timeout_thread_created
165165
# Timeout</tt> into your classes so they have a #timeout method, as well as
166166
# a module method, so you can call it directly as Timeout.timeout().
167167
def timeout(sec, klass = nil, message = nil, &block) #:yield: +sec+
168-
raise ArgumentError, "Timeout sec must be a non-negative number" if sec && !(sec.is_a?(Numeric) && sec >= 0)
169168
return yield(sec) if sec == nil or sec.zero?
169+
raise ArgumentError, "Timeout sec must be a non-negative number" if 0 > sec
170170

171171
message ||= "execution expired"
172172

0 commit comments

Comments
 (0)