On 2/19/2019 10:06 AM, Chris Angelico wrote:
On Wed, Feb 20, 2019 at 2:04 AM Chris Angelico <ros...@gmail.com> wrote:

On Wed, Feb 20, 2019 at 1:59 AM songbird <songb...@anthive.com> wrote:

MRAB wrote:
...
Don't use a bare except, it'll catch _any_ exception.

   that's ok with this code IMO, but i see your point.


Not really, no. It means that ANY bug (barring an outright syntax
error) inside the try block will silently move you on to the next
check, possibly after printing out the message.

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.

KeyboardInterrupt, SystemExit, and GeneratorExit are BaseExceptions but not Exceptions

--
Terry Jan Reedy

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

Reply via email to