mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #8046 from pmahoney/exceptions_as_flow_control
Replace flow-control exception with explicit test.
This commit is contained in:
commit
5bbe245a51
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue