зеркало из https://github.com/github/ruby.git
[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:
Родитель
e4f891ce8d
Коммит
95ef545997
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче