Project

General

Profile

Actions

Bug #733

closed

$! = nil in at_exit

Added by mame (Yusuke Endoh) over 15 years ago. Updated about 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
1.8,6 & up
[ruby-dev:37047]

Description

=begin
遠藤です。

1.8.5 以前では、at_exit の中で $! = nil をすることでスタックトレースの
出力を止めることができました。

$ ruby -ve 'at_exit { $! = nil }; raise'
ruby 1.8.5 (2006-08-25) [i486-linux]

1.8.6 以降ではこれができなくなっています。

$ ruby18 -ve 'at_exit { $! = nil }; raise'
ruby 1.8.7 (2008-11-08 revision 20151) [i686-linux]
-e:1: unhandled exception

スタックトレースを自分で整形して表示したいときに、1.8.5 の挙動の方が
便利です。

--
Yusuke ENDOH
=end

Actions #1

Updated by shyouhei (Shyouhei Urabe) about 15 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Status changed from Open to Assigned
  • ruby -v set to 1.8,6 & up

=begin

=end

Updated by kosaki (Motohiro KOSAKI) about 12 years ago

  • Status changed from Assigned to Closed

これ、いまさら1.8系の仕様変えるとかありえないと思うのでcloseしますね。1.9系だとそもそも$!がreadonlyなので1.9に移す話でもなさそう

$ ruby-193 -ve 'at_exit { $! = nil }; raise'
ruby 1.9.3p105 (2012-02-13) [x86_64-linux]
-e:1:in block in <main>': $! is a read-only variable (NameError) -e:1:in ': unhandled exception

認識間違っていたらreopenしてください

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0