Skip to content

Commit 73dc427

Browse files
authored
Merge pull request #18 from taketo1113/fix-syntax-error-ruby-2.4
Fix SyntaxError: unexpected keyword_rescue, expecting keyword_end in Ruby 2.4 and earlier
2 parents af45326 + b7cea1c commit 73dc427

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/envutil.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ def dump(pid, timeout: 60, reprieve: timeout&.div(4))
104104
else
105105
return unless dpid
106106
[[timeout, :TERM], [reprieve, :KILL]].find do |t, sig|
107-
return EnvUtil.timeout(t) {Process.wait(dpid)}
108-
rescue Timeout::Error
109-
Process.kill(sig, dpid)
107+
begin
108+
return EnvUtil.timeout(t) {Process.wait(dpid)}
109+
rescue Timeout::Error
110+
Process.kill(sig, dpid)
111+
end
110112
end
111113
true
112114
end

0 commit comments

Comments
 (0)