mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
core_assertions.rb: Support old rubies
Some symbol argument might not be accepted by Process.clock_gettime.
This commit is contained in:
parent
e67ef294fe
commit
bfa4073dc2
1 changed files with 1 additions and 2 deletions
|
@ -731,8 +731,7 @@ eom
|
||||||
CLOCK_MONOTONIC
|
CLOCK_MONOTONIC
|
||||||
].find do |clk|
|
].find do |clk|
|
||||||
if Process.const_defined?(clk)
|
if Process.const_defined?(clk)
|
||||||
clk = clk.to_sym
|
[clk.to_sym, Process.const_get(clk)].find do |clk|
|
||||||
begin
|
|
||||||
Process.clock_gettime(clk)
|
Process.clock_gettime(clk)
|
||||||
rescue
|
rescue
|
||||||
# Constants may be defined but not implemented, e.g., mingw.
|
# Constants may be defined but not implemented, e.g., mingw.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue