ruby-changes:5621
From: shyouhei <ko1@a...>
Date: Fri, 13 Jun 2008 12:02:34 +0900 (JST)
Subject: [ruby-changes:5621] Ruby:r17127 (ruby_1_8_6): merge revision(s) 15408:
shyouhei 2008-06-13 12:02:17 +0900 (Fri, 13 Jun 2008) New Revision: 17127 Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/lib/irb.rb branches/ruby_1_8_6/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_6/ChangeLog?r1=17127&r2=17126&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=17127&r2=17126&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/lib/irb.rb?r1=17127&r2=17126&diff_format=u Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 17126) +++ ruby_1_8_6/ChangeLog (revision 17127) @@ -1,3 +1,8 @@ +Fri Jun 13 12:01:57 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:57:46 2008 Yukihiro Matsumoto <matz@r...> * lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime Index: ruby_1_8_6/version.h =================================================================== --- ruby_1_8_6/version.h (revision 17126) +++ ruby_1_8_6/version.h (revision 17127) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-13" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20080613 -#define RUBY_PATCHLEVEL 171 +#define RUBY_PATCHLEVEL 172 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_6/lib/irb.rb =================================================================== --- ruby_1_8_6/lib/irb.rb (revision 17126) +++ ruby_1_8_6/lib/irb.rb (revision 17127) @@ -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/