In article <mailman.2202.1277677180.32709.python-l...@python.org>,
Thomas Jollans  <tho...@jollans.com> wrote:
>
>(3) Why not
>
>try:
>    import x
>    import y
>    import z
>except ImportError as exc:
>    display_error_properly(exc)
>    raise exc

Why not?  Because that destroys the original traceback.  Inside an
except clause, you should almost always use a bare raise.  (I'm not
absolutely certain that the new "as" subclause doesn't fix the problem,
but why not stick with an idiom guaranteed to work in all versions of
Python.)
-- 
Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to