mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Close then unlink tempfiles on Windows
In ruby/ruby test actions, number of "leaked tempfile" messages are shown on Windows. As Windows disallows removing open files, `Tempfile#unlink` fails silently before `#close`. Close then unlink by `#close!` instead. https://github.com/rubygems/rubygems/commit/fe0b88ac30
This commit is contained in:
parent
e4f891ce8d
commit
95ef545997
1 changed files with 2 additions and 4 deletions
|
@ -153,15 +153,13 @@ class Gem::TestCase < Test::Unit::TestCase
|
|||
|
||||
return captured_stdout.read, captured_stderr.read
|
||||
ensure
|
||||
captured_stdout.unlink
|
||||
captured_stderr.unlink
|
||||
$stdout.reopen orig_stdout
|
||||
$stderr.reopen orig_stderr
|
||||
|
||||
orig_stdout.close
|
||||
orig_stderr.close
|
||||
captured_stdout.close
|
||||
captured_stderr.close
|
||||
captured_stdout.close!
|
||||
captured_stderr.close!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue