< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #12302 has been updated by Nobuyoshi Nakada.
Description updated
Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
Bug #12302: at_exit status status is changed by raising/rescueing a exception in at_exit
https://bugs.ruby-lang.org/issues/12302#change-58212
* Author: Michael Grosser
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
~~~ruby
at_exit do
puts "1 #{$!}"
end
at_exit do
puts "2 #{$!}"
raise 'x' rescue nil
end
at_exit do
puts "3 #{$!}"
exit 1
end
~~~
Nr 3 runs first and exits 1 ... Nr2 receives the correct exit status ... but using raise/rescue there overrides `$!` and Nr 1 thinks it is a clean exit ...
seems semi related to https://bugs.ruby-lang.org/issues/5218 ... ideally the `at_exit` block should restore the previous `$!` ... or give some other way of knowing the exit status like passing it to the block
~~~ruby
at_exit do |exception|
...
end
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>