aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-10-20 14:34:08 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-10-20 14:34:08 +0900
commitbb849ffdb18305f01457de4e9848c830eb83a2d7 (patch)
tree1da3fb74a6fdce77a9206e9aedfac09c8a296cc3 /tool
parent9ea1ee66c9852557f32f511db10ccc26e1f8c938 (diff)
downloadruby-bb849ffdb18305f01457de4e9848c830eb83a2d7.tar.gz
Added explicitly begin-end block for Ruby 2.4.
strscan, ipaddr and some default gems still support Ruby 2.4. After this, I extract this CoreAssertions to their repositories.
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/core_assertions.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index 4eb56b04be..358e7d9551 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -781,11 +781,13 @@ eom
].find do |c|
if Process.const_defined?(c)
[c.to_sym, Process.const_get(c)].find do |clk|
- Process.clock_gettime(clk)
- rescue
- # Constants may be defined but not implemented, e.g., mingw.
- else
- PERFORMANCE_CLOCK = clk
+ begin
+ Process.clock_gettime(clk)
+ rescue
+ # Constants may be defined but not implemented, e.g., mingw.
+ else
+ PERFORMANCE_CLOCK = clk
+ end
end
end
end