summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCosmic Oppai <[email protected]>2024-11-19 01:56:21 +0530
committergit <[email protected]>2024-12-03 06:49:57 +0000
commitf6b62d001a7ee868a745054d2e6146167570e682 (patch)
treef71c430f767ccf1710b354712470a131b3f71466 /lib
parent7dc7aab4e9496b131f6355808bde1369dc7f1ab2 (diff)
[ruby/timeout] removed the non numeric check
https://github.com/ruby/timeout/commit/7d2af46a00 Co-authored-by: Jeremy Evans <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/timeout.rb2
1 files changed, 1 insertions, 1 deletions
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</tt> 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"