From 0c3d51318538006d2c4393fb96ead184914e5d08 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 5 May 2014 16:38:53 +0000 Subject: * lib/open-uri.rb (OpenURI.open_uri): Call StringIO#close only if the StringIO object is not closed yet. Reported by Jordi Massaguer Pla. [ruby-core:42538] [Bug #6010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/open-uri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/open-uri.rb') diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 264c8501cf..f9822a9847 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -155,7 +155,7 @@ module OpenURI if io.respond_to? :close! io.close! # Tempfile else - io.close + io.close if !io.closed? end end else -- cgit v1.2.3