On 2019-02-19, Chris Angelico <ros...@gmail.com> wrote:

> Oh, and not just bugs either. If the user hits Ctrl-C at just the
> right moment, KeyboardInterrupt will be raised. You'll swallow that
> exception silently, preventing the user-requested halt, and going and
> doing the wrong thing. Don't use a bare except clause even if your
> code is 100% perfect every time. (And anyone who thinks their code is
> perfect hasn't tested it.)

IMO, you're allowed to use a bare except clause to do cleanup or
logging as long as the execption handler ends with the line

   raise

Something like this:

-- 
Grant Edwards               grant.b.edwards        Yow! I just went below the
                                  at               poverty line!
                              gmail.com            

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to