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

ruby-changes:5619

From: shyouhei <ko1@a...>
Date: Fri, 13 Jun 2008 12:01:01 +0900 (JST)
Subject: [ruby-changes:5619] Ruby:r17125 (ruby_1_8_5): merge revision(s) 15408:

shyouhei	2008-06-13 12:00:44 +0900 (Fri, 13 Jun 2008)

  New Revision: 17125

  Modified files:
    branches/ruby_1_8_5/ChangeLog
    branches/ruby_1_8_5/lib/irb.rb
    branches/ruby_1_8_5/version.h

  Log:
    merge revision(s) 15408:
    * lib/irb.rb (IRB::Irb::eval_input): rescues Interrupt and other than
      SystemExit and SignalException.  [ruby-core:15359]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/lib/irb.rb?r1=17125&r2=17124&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/version.h?r1=17125&r2=17124&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/ChangeLog?r1=17125&r2=17124&diff_format=u

Index: ruby_1_8_5/ChangeLog
===================================================================
--- ruby_1_8_5/ChangeLog	(revision 17124)
+++ ruby_1_8_5/ChangeLog	(revision 17125)
@@ -1,3 +1,8 @@
+Fri Jun 13 11:58:34 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/irb.rb (IRB::Irb::eval_input): rescues Interrupt and other than
+	  SystemExit and SignalException.  [ruby-core:15359]
+
 Fri Jun 13 11:56:28 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
Index: ruby_1_8_5/version.h
===================================================================
--- ruby_1_8_5/version.h	(revision 17124)
+++ ruby_1_8_5/version.h	(revision 17125)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2008-06-13"
 #define RUBY_VERSION_CODE 185
 #define RUBY_RELEASE_CODE 20080613
-#define RUBY_PATCHLEVEL 170
+#define RUBY_PATCHLEVEL 171
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_5/lib/irb.rb
===================================================================
--- ruby_1_8_5/lib/irb.rb	(revision 17124)
+++ ruby_1_8_5/lib/irb.rb	(revision 17125)
@@ -149,10 +149,15 @@
             line.untaint
 	    @context.evaluate(line, line_no)
 	    output_value if @context.echo?
-	  rescue StandardError, ScriptError, Abort
-	    $! = RuntimeError.new("unknown exception raised") unless $!
-	    print $!.class, ": ", $!, "\n"
-	    if  $@[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && $!.class.to_s !~ /^IRB/
+	    exc = nil
+	  rescue Interrupt => exc
+	  rescue SystemExit, SignalException
+	    raise
+	  rescue Exception => exc
+	  end
+	  if exc
+	    print exc.class, ": ", exc, "\n"
+	    if exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/
 	      irb_bug = true 
 	    else
 	      irb_bug = false
@@ -161,7 +166,7 @@
 	    messages = []
 	    lasts = []
 	    levels = 0
-	    for m in $@
+	    for m in exc.backtrace
 	      m = @context.workspace.filter_backtrace(m) unless irb_bug
 	      if m
 		if messages.size < @context.back_trace_limit
@@ -183,8 +188,7 @@
 	    print "Maybe IRB bug!!\n" if irb_bug
 	  end
           if $SAFE > 2
-            warn "Error: irb does not work for $SAFE level higher than 2"
-            exit 1
+            abort "Error: irb does not work for $SAFE level higher than 2"
           end
 	end
       end

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

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