Antoon Pardon wrote:
> I then took a look at http://docs.python.org/lib/module-exceptions.html
> which describes the exception heirarchy as follows:
>
> Exception
> +-- SystemExit
> +-- StopIteration
> +-- StandardError
> | +
> | + All kind of error exceptions
> | +
> +---Warning
> +
> + All kind of warnings
> +
>
> and came to the conclusion, that it would be better to write my code
> as follows:
>
> for case in all_cases:
> try:
> treat(case)
> except StandardError, ErrInfo:
> generate_traceback()
You've already been pointed to `PEP 352`_, but just to highlight the
salient point, I believe what you want to write is::
try:
...
except (KeyboardInterrupt, SystemExit):
raise
except:
...
.. _PEP 352: http://www.python.org/peps/pep-0352.html
STeVe
--
http://mail.python.org/mailman/listinfo/python-list