From 58a9bf0c4c2fc5aa70d4b1875ea59332191cf112 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 3 Apr 2012 19:30:10 +0000 Subject: [PATCH] Don't call f.close if f is nil or already closed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/open-uri/test_open-uri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb index 5f501d16cc..916b2af23f 100644 --- a/test/open-uri/test_open-uri.rb +++ b/test/open-uri/test_open-uri.rb @@ -152,7 +152,7 @@ class TestOpenURI < Test::Unit::TestCase assert_equal("200", f.status[0]) assert_equal("without_block", f.read) ensure - f.close + f.close if f && !f.closed? end } end