core_assertions.rb: Support old rubies

Some symbol argument might not be accepted by Process.clock_gettime.
This commit is contained in:
Nobuyoshi Nakada 2023-04-29 02:09:55 +09:00 committed by Hiroshi SHIBATA
parent e67ef294fe
commit bfa4073dc2

View file

@ -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.