summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/util.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/rubygems/util.rb b/lib/rubygems/util.rb
index e862458d21..af53e599b5 100644
--- a/lib/rubygems/util.rb
+++ b/lib/rubygems/util.rb
@@ -41,7 +41,7 @@ module Gem::Util
def self.popen *command
begin
- r, = IO.popen command
+ r, = IO.popen command, &:read
rescue TypeError # ruby 1.8 only supports string command
r, w = IO.pipe
@@ -54,12 +54,13 @@ module Gem::Util
w.close
- Process.wait pid
-
- r
+ begin
+ return r.read
+ ensure
+ Process.wait pid
+ end
end
- r.read
end
end