aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-21 23:05:41 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-21 23:05:41 +0000
commit24a7251eb04fc7b90e325c082a521f5b86020c3f (patch)
tree015ae2e6909fd287ac1b3b18e0675196e181fb0d /lib/tempfile.rb
parentd2abd1f5031e4322795672bd6374b0aeb167e576 (diff)
downloadruby-24a7251eb04fc7b90e325c082a521f5b86020c3f.tar.gz
lib/*: remove closed checks
Follow r56795. Since Ruby 2.2, calling #close on a closed socket no longer raises exceptions. * lib/cgi/session.rb (update): remove closed? check * lib/net/http.rb (finish, transport_request): ditto * lib/net/imap.rb (disconnect): ditto * lib/net/pop.rb (do_start, do_finish): ditto * lib/net/smtp.rb (do_start, do_finish): ditto * lib/open3.rb (popen_run, pipeline_run): ditto * lib/pstore.rb (transaction): ditto * lib/shell/process-controller.rb (sfork): * lib/tempfile (_close, call, Tempfile.create): ditto * lib/webrick/httpauth/htdigest.rb (flush): ditto * lib/webrick/httpauth/htpasswd.rb (flush): ditto * lib/webrick/server.rb (start_thread, cleanup_shutdown_pipe): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index b0ebd0be0e..36b0e1a481 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -147,7 +147,7 @@ class Tempfile < DelegateClass(File)
end
def _close # :nodoc:
- @tmpfile.close unless @tmpfile.closed?
+ @tmpfile.close
end
protected :_close
@@ -252,7 +252,7 @@ class Tempfile < DelegateClass(File)
warn "removing #{@tmpfile.path}..." if $DEBUG
- @tmpfile.close unless @tmpfile.closed?
+ @tmpfile.close
begin
File.unlink(@tmpfile.path)
rescue Errno::ENOENT
@@ -334,7 +334,7 @@ def Tempfile.create(basename="", tmpdir=nil, mode: 0, **options)
begin
yield tmpfile
ensure
- tmpfile.close if !tmpfile.closed?
+ tmpfile.close
File.unlink tmpfile
end
else