提交 5bbe245a 编写于 作者: R Rafael Mendonça França

Merge pull request #8046 from pmahoney/exceptions_as_flow_control

Replace flow-control exception with explicit test.
......@@ -23,10 +23,10 @@ def self.atomic_write(file_name, temp_dir = Dir.tmpdir)
yield temp_file
temp_file.close
begin
if File.exists?(file_name)
# Get original file permissions
old_stat = stat(file_name)
rescue Errno::ENOENT
else
# If not possible, probe which are the default permissions in the
# destination directory.
old_stat = probe_stat_in(dirname(file_name))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册