Skip to content

Commit 74c4a07

Browse files
committed
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
1 parent 9e489a9 commit 74c4a07

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Fri Jun 13 11:58:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* lib/irb.rb (IRB::Irb::eval_input): rescues Interrupt and other than
4+
SystemExit and SignalException. [ruby-core:15359]
5+
16
Fri Jun 13 11:56:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
27

38
* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime

lib/irb.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,15 @@ def eval_input
149149
line.untaint
150150
@context.evaluate(line, line_no)
151151
output_value if @context.echo?
152-
rescue StandardError, ScriptError, Abort
153-
$! = RuntimeError.new("unknown exception raised") unless $!
154-
print $!.class, ": ", $!, "\n"
155-
if $@[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && $!.class.to_s !~ /^IRB/
152+
exc = nil
153+
rescue Interrupt => exc
154+
rescue SystemExit, SignalException
155+
raise
156+
rescue Exception => exc
157+
end
158+
if exc
159+
print exc.class, ": ", exc, "\n"
160+
if exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/
156161
irb_bug = true
157162
else
158163
irb_bug = false
@@ -161,7 +166,7 @@ def eval_input
161166
messages = []
162167
lasts = []
163168
levels = 0
164-
for m in $@
169+
for m in exc.backtrace
165170
m = @context.workspace.filter_backtrace(m) unless irb_bug
166171
if m
167172
if messages.size < @context.back_trace_limit
@@ -183,8 +188,7 @@ def eval_input
183188
print "Maybe IRB bug!!\n" if irb_bug
184189
end
185190
if $SAFE > 2
186-
warn "Error: irb does not work for $SAFE level higher than 2"
187-
exit 1
191+
abort "Error: irb does not work for $SAFE level higher than 2"
188192
end
189193
end
190194
end

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-13"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080613
5-
#define RUBY_PATCHLEVEL 170
5+
#define RUBY_PATCHLEVEL 171
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)