summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-29 02:09:55 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-09-10 16:00:29 +0900
commitbfa4073dc21cd313a0b8e8e008868dd913ef8e5f (patch)
tree9d015307e597cbf4305b38c267817be729ce20d6
parente67ef294fe2f6f6778c063ac7f777e5605b52052 (diff)
core_assertions.rb: Support old rubies
Some symbol argument might not be accepted by Process.clock_gettime.
-rw-r--r--tool/lib/core_assertions.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index 5777d79741..7845d23729 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -731,8 +731,7 @@ eom
CLOCK_MONOTONIC
].find do |clk|
if Process.const_defined?(clk)
- clk = clk.to_sym
- begin
+ [clk.to_sym, Process.const_get(clk)].find do |clk|
Process.clock_gettime(clk)
rescue
# Constants may be defined but not implemented, e.g., mingw.