Skip to content

Commit 42bb73c

Browse files
committed
support ruby 1.9.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent b0d1586 commit 42bb73c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tool/vcs.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,20 @@ def popen(*args)
9191
end
9292
using DebugPOpen
9393
module DebugSystem
94-
def system(*args, **opts)
95-
STDERR.puts [*args, **opts].inspect if $DEBUG
94+
def system(*args)
95+
STDERR.puts args.inspect if $DEBUG
96+
exception = false
97+
opts = Hash.try_convert(args[-1])
9698
if RUBY_VERSION >= "2.6"
99+
unless opts
100+
opts = {}
101+
args << opts
102+
end
97103
exception = opts.fetch(:exception) {opts[:exception] = true}
98-
else
104+
elsif opts
99105
exception = opts.delete(:exception) {true}
100106
end
101-
ret = super(*args, **opts)
107+
ret = super(*args)
102108
raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
103109
ret
104110
end

0 commit comments

Comments
 (0)