diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-20 15:02:55 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-20 15:02:55 +0000 |
commit | 1721dfa0ea963a85d4ac1e3415eb18ef427d4d36 (patch) | |
tree | addd29684ba6c0d7c221a26320b1fffbb9b649c4 /lib/rubygems | |
parent | f14f0d34641ece73d77781856eed70de760f9d9f (diff) |
release monitor correctly.
* lib/rubygems/core_ext/kernel_require.rb: sometimes
`Kernel.send(:gem, spec.name)` can raise some errors
(Gem::MissingSpecError I observed) and this method
doesn't release RUBYGEMS_ACTIVATION_MONITOR correctly.
This patch fix this problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems')
-rwxr-xr-x | lib/rubygems/core_ext/kernel_require.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index 71a301c323..3172ef9be6 100755 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -44,7 +44,12 @@ module Kernel spec = Gem.find_unresolved_default_spec(path) if spec Gem.remove_unresolved_default_spec(spec) - Kernel.send(:gem, spec.name) + begin + Kernel.send(:gem, spec.name) + rescue Exception + RUBYGEMS_ACTIVATION_MONITOR.exit + raise + end end # If there are no unresolved deps, then we can use just try |