From bfa4073dc21cd313a0b8e8e008868dd913ef8e5f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 29 Apr 2023 02:09:55 +0900 Subject: [PATCH] core_assertions.rb: Support old rubies Some symbol argument might not be accepted by Process.clock_gettime. --- tool/lib/core_assertions.rb | 3 +-- 1 file changed, 1 insertion(+), 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.