summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 03:00:44 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 03:00:44 +0000
commit74c4a0719c08347e8ca703a2565609100c705750 (patch)
tree76e1a38dc725ef641e81c4cc2bda3d17292c9253
parent9e489a9dead8f9799abe2d8df3b85a51fd2fd746 (diff)
merge revision(s) 15408:
* lib/irb.rb (IRB::Irb::eval_input): rescues Interrupt and other than SystemExit and SignalException. [ruby-core:15359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/irb.rb18
-rw-r--r--version.h2
3 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 80eae866e2e..8af94bfe87d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 13 11:58:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
diff --git a/lib/irb.rb b/lib/irb.rb
index 65b15127407..1f49768b7d1 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -149,10 +149,15 @@ module IRB
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 @@ module IRB
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 @@ module IRB
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
diff --git a/version.h b/version.h
index f6dac2c2f7e..30e7f31bf6e 100644
--- a/version.h
+++ b/version.h
@@ -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