Skip to content

Commit

Permalink
trying to make Rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
skaes committed Sep 25, 2023
1 parent 4acae51 commit c2cfb06
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/dalli/protocol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ module Protocol
# Ruby 3.2 raises IO::TimeoutError on blocking reads/writes, but
# it is not defined in earlier Ruby versions.
require 'timeout'
if defined?(IO::TimeoutError)
TIMEOUT_ERRORS = [Timeout::Error, IO::TimeoutError]
else
TIMEOUT_ERRORS = [Timeout::Error]
end
TIMEOUT_ERRORS =
if defined?(IO::TimeoutError)
[Timeout::Error, IO::TimeoutError]
else
[Timeout::Error]
end
end
end

0 comments on commit c2cfb06

Please sign in to comment.