From d752cf7601adbe4bc2dc658effc2f61563a7dfb7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 25 Nov 2022 14:22:37 +0900 Subject: Use class methods of `File` over `Kernel.open` and `IO.read` --- tool/mk_builtin_loader.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tool/mk_builtin_loader.rb') diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb index c4f36889d6..94af846a7e 100644 --- a/tool/mk_builtin_loader.rb +++ b/tool/mk_builtin_loader.rb @@ -276,10 +276,10 @@ def mk_builtin_header file collect_builtin(base, Ripper.sexp(code), 'top', bs = {}, inlines = {}) begin - f = open(ofile, 'w') - rescue Errno::EACCES + f = File.open(ofile, 'w') + rescue SystemCallError # EACCES, EPERM, EROFS, etc. # Fall back to the current directory - f = open(File.basename(ofile), 'w') + f = File.open(File.basename(ofile), 'w') end begin if File::ALT_SEPARATOR -- cgit v1.2.3