diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-25 14:22:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-01 02:28:49 +0900 |
commit | d752cf7601adbe4bc2dc658effc2f61563a7dfb7 (patch) | |
tree | 7acc875d1933b330f96c7e3d7a31d61da5e77387 /tool/mk_builtin_loader.rb | |
parent | a0b0365e905e1ac51998ace7e6fc723406a2f157 (diff) | |
download | ruby-d752cf7601adbe4bc2dc658effc2f61563a7dfb7.tar.gz |
Use class methods of `File` over `Kernel.open` and `IO.read`
Diffstat (limited to 'tool/mk_builtin_loader.rb')
-rw-r--r-- | tool/mk_builtin_loader.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |