Stefan Ram <r...@zedat.fu-berlin.de> wrote: > Chris Green <c...@isbd.net> writes: > >So that, as is always advised, I can catch the specific exception > >being thrown! > > It usually is advisable to be more specific when catching > exceptions. The worst thing to do is surely a bare "except:" > which then ignores the exception. > > A general "except Exception:" is slightly better, since it > will not catch SystemExit and KeyboardInterrupt exceptions. > > According to me, you should only catch a specific exception > if you know better than your caller what to do in this case. > Otherwise just let it pass through to your caller. > > "better than your caller"??? If I ignore the exception then the program just exits, if I want the program to do something useful about it (like try again) then I have to catch the specific exception as I don't want to try again with other exceptions.
-- Chris Green ยท -- https://mail.python.org/mailman/listinfo/python-list