summaryrefslogtreecommitdiff
path: root/lib/open-uri.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-05 16:38:53 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-05 16:38:53 +0000
commit0c3d51318538006d2c4393fb96ead184914e5d08 (patch)
tree4928341e4894b5b7b7d60ae8975ff16d692eb5d6 /lib/open-uri.rb
parent5ab5d9219183d10947a2d95865fd87b962f065a7 (diff)
downloadruby-0c3d51318538006d2c4393fb96ead184914e5d08.tar.gz
* 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
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r--lib/open-uri.rb2
1 files changed, 1 insertions, 1 deletions
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