summaryrefslogtreecommitdiff
path: root/lib/open-uri.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-23 13:49:56 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-23 13:49:56 +0000
commitab63cdf1ab776ca7ff137c0969bef30965450566 (patch)
treef7a5dae3f808e86c94672696391d8781324a41d8 /lib/open-uri.rb
parentdafab791d56e25a02d58e0ddcfd969dabaf89014 (diff)
* lib/open-uri.rb: use respond_to? to test Tempfile.
[ruby-dev:45995] [Bug #6781] reported by hsbt (Hiroshi SHIBATA). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r--lib/open-uri.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index 07034654a2..7f2a056370 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -149,8 +149,8 @@ module OpenURI
begin
yield io
ensure
- if io.kind_of? Tempfile
- io.close!
+ if io.respond_to? :close!
+ io.close! # Tempfile
else
io.close
end