[前][次][番号順一覧][スレッド一覧]

ruby-changes:49983

From: nobu <ko1@a...>
Date: Tue, 30 Jan 2018 11:20:10 +0900 (JST)
Subject: [ruby-changes:49983] nobu:r62101 (trunk): vcs.rb: fix errors

nobu	2018-01-30 11:20:02 +0900 (Tue, 30 Jan 2018)

  New Revision: 62101

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62101

  Log:
    vcs.rb: fix errors
    
    * tool/vcs.rb (DebugSystem#system): fix undefined local variable
      error.  as system doesn't accept `exception:` option before 2.6,
      remove it from `opts`.

  Modified files:
    trunk/tool/vcs.rb
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 62100)
+++ tool/vcs.rb	(revision 62101)
@@ -94,7 +94,9 @@ else https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L94
     def system(*args, **opts)
       STDERR.puts [*args, **opts].inspect if $DEBUG
       if RUBY_VERSION >= "2.6"
-        opts[:exception] = true unless opts.key?(:exception)
+        exception = opts.fetch(:exception) {opts[:exception] = true}
+      else
+        exception = opts.delete(:exception) {true}
       end
       ret = super(*args, **opts)
       raise "Command failed with status (#$?): #{args[0]}" if exception and !ret

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]