Skip to content

Commit 408f9d3

Browse files
committed
remove redundant rescue block
1 parent e5df779 commit 408f9d3

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

lib/rubygems/package.rb

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -471,18 +471,13 @@ def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
471471
end
472472

473473
if entry.file?
474-
begin
475-
File.open(destination, "wb") do |out|
476-
copy_stream(tar.io, out, entry.size)
477-
# Flush needs to happen before chmod because there could be data
478-
# in the IO buffer that needs to be written, and that could be
479-
# written after the chmod (on close) which would mess up the perms
480-
out.flush
481-
out.chmod file_mode(entry.header.mode) & ~File.umask
482-
end
483-
rescue Errno::EINVAL
484-
gem_name = @spec ? @spec.full_name : "unknown"
485-
raise Gem::Package::InvalidWindowsFileNameError.new(full_name, gem_name)
474+
File.open(destination, "wb") do |out|
475+
copy_stream(tar.io, out, entry.size)
476+
# Flush needs to happen before chmod because there could be data
477+
# in the IO buffer that needs to be written, and that could be
478+
# written after the chmod (on close) which would mess up the perms
479+
out.flush
480+
out.chmod file_mode(entry.header.mode) & ~File.umask
486481
end
487482
end
488483

0 commit comments

Comments
 (0)