Merge pull request #8046 from pmahoney/exceptions_as_flow_control

Replace flow-control exception with explicit test.
This commit is contained in:
Rafael Mendonça França 2012-10-28 13:22:45 -07:00
commit 5bbe245a51
1 changed files with 2 additions and 2 deletions

View File

@ -23,10 +23,10 @@ class File
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))