I don't get why sys.exit(1) doesn't exit the while loop in the follow case

Nobody nobody at nowhere.com
Tue Oct 12 02:18:37 CEST 2010


On Mon, 11 Oct 2010 05:42:39 -0700, Ethan Furman wrote:

>>>If I'm catching exceptions in order to perform clean-up, I'll use a bare
>>>except and re-raise the exception afterwards. In that situation, a bare
>>>except is usually the right thing to do.
>> 
>> Wrong way to do it.
> 
> What, then, is the right way to do it?

I presume that he's referring to "finally". Which is reasonable enough
given what I wrote, but isn't always convenient.

My point was that bare excepts aren't a problem if you're going to
re-raise the exception.




More information about the Python-list mailing list