From b7cea1cf7cb5330363ed87602ae52f26d27d7fa1 Mon Sep 17 00:00:00 2001 From: Taketo Takashima Date: Tue, 7 Oct 2025 22:35:23 +0900 Subject: [PATCH] Fix SyntaxError: unexpected keyword_rescue, expecting keyword_end in Ruby 2.4 and earlier --- lib/envutil.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/envutil.rb b/lib/envutil.rb index fef9a0c..ea1f83e 100644 --- a/lib/envutil.rb +++ b/lib/envutil.rb @@ -104,9 +104,11 @@ def dump(pid, timeout: 60, reprieve: timeout&.div(4)) else return unless dpid [[timeout, :TERM], [reprieve, :KILL]].find do |t, sig| - return EnvUtil.timeout(t) {Process.wait(dpid)} - rescue Timeout::Error - Process.kill(sig, dpid) + begin + return EnvUtil.timeout(t) {Process.wait(dpid)} + rescue Timeout::Error + Process.kill(sig, dpid) + end end true end