summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-02-11 21:29:17 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-03-30 18:38:42 +1300
commit9b9bbaec111c34d15d75750e300d94fb5c30c8b1 (patch)
tree4f0946b1609fef7b8587bb1e25c9153aafae5c19
parent4c53dc970bf82e4c5fb237be4b2404bcb07496d2 (diff)
Update lib/timeout.rb
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4173
-rw-r--r--lib/timeout.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index 43f26f5..9625db7 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -81,7 +81,7 @@ module Timeout
message ||= "execution expired".freeze
- if scheduler = Fiber.scheduler and scheduler.respond_to?(:timeout_raise)
+ if (scheduler = Fiber.scheduler)&.respond_to?(:timeout_raise)
return scheduler.timeout_raise(sec, klass || Error, message, &block)
end