summaryrefslogtreecommitdiff
path: root/lib/rubygems/source.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-03-16 13:48:03 +0900
committerHiroshi SHIBATA <[email protected]>2023-03-17 18:50:55 +0900
commit70164eec0f48a691dd039f55ac897036aa32e5cf (patch)
treee991dceeb7aa2d730d60ae8ca8ce512fa7517823 /lib/rubygems/source.rb
parentfef0313ec79beab2383e30062803a0f21b198b21 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/RescueModifier
https://github.com/rubygems/rubygems/commit/b490379eab
Diffstat (limited to 'lib/rubygems/source.rb')
-rw-r--r--lib/rubygems/source.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb
index 74ea2c61b3..c57b173a44 100644
--- a/lib/rubygems/source.rb
+++ b/lib/rubygems/source.rb
@@ -135,7 +135,11 @@ class Gem::Source
if File.exist? local_spec
spec = Gem.read_binary local_spec
- spec = Marshal.load(spec) rescue nil
+ spec = begin
+ Marshal.load(spec)
+ rescue
+ nil
+ end
return spec if spec
end