diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-24 15:37:51 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-24 15:37:51 +0000 |
commit | ad5757276d48761ff9e071991d3957f75ce2d4b4 (patch) | |
tree | 8ccf34537a5b2c37c358cde97260588e88593e4a /lib | |
parent | b9bfc5b8aa895a1c7bf456fde79b71f5f49edb3e (diff) |
merge revision(s) 44184: [Backport #9247]
* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because
it may be set before the body.
Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247]
* lib/cgi/core.rb: Ditto.
* lib/drb/ssl.rb: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi/core.rb | 5 | ||||
-rw-r--r-- | lib/drb/ssl.rb | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb index 27137a2032..1ab8e8c7d9 100644 --- a/lib/cgi/core.rb +++ b/lib/cgi/core.rb @@ -574,14 +574,15 @@ class CGI raise EOFError, "bad boundary end of body part" unless boundary_end =~ /--/ params.default = [] params - ensure - if $! && tempfiles + rescue Exception + if tempfiles tempfiles.each {|t| if t.path t.unlink end } end + raise end # read_multipart private :read_multipart def create_body(is_large) #:nodoc: diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb index 8651702797..e7d9569eb6 100644 --- a/lib/drb/ssl.rb +++ b/lib/drb/ssl.rb @@ -328,8 +328,9 @@ module DRb end begin ssl = @config.accept(soc) - ensure - soc.close if $! + rescue Exception + soc.close + raise end self.class.new(uri, ssl, @config, true) rescue OpenSSL::SSL::SSLError |