Skip to content

Commit

Permalink
Update lib/timeout.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
  • Loading branch information
ioquatix and nobu committed Mar 30, 2021
1 parent 4c53dc9 commit 9b9bbae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def timeout(sec, klass = nil, message = nil, &block) #:yield: +sec+

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

Expand Down

0 comments on commit 9b9bbae

Please sign in to comment.