NoneType Error

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Mon Jun 16 11:29:09 CEST 2008

Gabriel Genellina a écrit :
> En Sun, 15 Jun 2008 05:35:18 -0300, Maryam Saeedi <ma.saeedi at> escribió:


> It appears that you want to catch all exceptions, just use Exception for that:
> try:
>    ...
> except Exception:
>    ...

Hem... That's definitively *not* an a good advice here IMHO. A catch-all 
may be useful near a program's 'top-level' to handle any other unhandled 
exception in a more user-friendly way (ie : log the error, warns whoever 
is in charge, try to cleanly dispose of resources / data / whatever so 
we don't break anything, and display a nice and visible error message to 
the user), but anywhere else you really want to know *exactly* which 
exception(s) you're expecting to handle here and let the other propagate.

More information about the Python-list mailing list