[Python-Dev] Breaking bug #411881 into manageable pieces

David Ascher DavidA@ActiveState.com
2002年3月20日 12:09:41 -0800


Aahz wrote:
>> On Wed, Mar 20, 2002, Guido van Rossum wrote:
> >
> > There's a standard idiom for this:
> >
> > try:
> > ...code...
> > except KeyboardInterrupt:
> > raise
> > except:
> > ...handler...
>> May I suggest yet one more alteration:
>> try:
> ...code...
> except (KeyboardInterrupt,SystemExit):
> raise
> except:
> ...handler...

Makes me wonder if it makes sense to move KeyboardInterrupt up the
hierarchy and promote the use of StandardError...
--david

AltStyle によって変換されたページ (->オリジナル) /