Skip to content

Commit ec2ff4f

Browse files
committed
Remove unnecessary begin/end in do/end block in _tmpdir.rb
1 parent 75ac1dd commit ec2ff4f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tool/lib/_tmpdir.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,14 @@ def list_tree(parent, indent = "", &block)
8585
warn colorize.notice("Children under ")+colorize.fail(tmpdir)+":"
8686
Dir.chdir(tmpdir) do
8787
ls.list_tree(".") do |path, st|
88-
begin
89-
if st.directory?
90-
Dir.rmdir(path)
91-
else
92-
File.unlink(path)
93-
end
94-
rescue Errno::EACCES
95-
# On Windows, a killed process may still hold file locks briefly.
96-
# Ignore and let FileUtils.rm_rf handle it below.
88+
if st.directory?
89+
Dir.rmdir(path)
90+
else
91+
File.unlink(path)
9792
end
93+
rescue Errno::EACCES
94+
# On Windows, a killed process may still hold file locks briefly.
95+
# Ignore and let FileUtils.rm_rf handle it below.
9896
end
9997
end
10098
end

0 commit comments

Comments
 (0)